Permalink
Browse files

Merge pull request #335 from daylerees/develop

Show an error when an artisan task's method cannot be found.
  • Loading branch information...
taylorotwell committed Feb 13, 2012
2 parents 620f3ba + 29d062d commit 53a20533f1fc529911c3effa20bd3cef86e24702
Showing with 9 additions and 2 deletions.
  1. +9 −2 laravel/cli/command.php
View
@@ -42,7 +42,14 @@ public static function run($arguments = array())
throw new \Exception("Sorry, I can't find that task.");
}
- $task->$method(array_slice($arguments, 1));
+ if(method_exists($task, $method))
+ {
+ $task->$method(array_slice($arguments, 1));
+ }
+ else
+ {
+ throw new \Exception("Sorry, I can't find that method!");
+ }
}
/**
@@ -186,4 +193,4 @@ protected static function format($bundle, $task)
return '\\'.$prefix.Str::classify($task).'_Task';
}
-}
+}

0 comments on commit 53a2053

Please sign in to comment.