Browse Source

Fix exception to be valid error default code 1 instead of 244.

mscherer 6 years ago
parent
commit
8104784e9c

+ 7 - 0
src/Console/Exception/ConsoleException.php

@@ -13,6 +13,7 @@
  */
 namespace Cake\Console\Exception;
 
+use Cake\Console\Command;
 use Cake\Core\Exception\Exception;
 
 /**
@@ -21,4 +22,10 @@ use Cake\Core\Exception\Exception;
  */
 class ConsoleException extends Exception
 {
+    /**
+     * Default exception code
+     *
+     * @var int
+     */
+    protected $_defaultCode = Command::CODE_ERROR;
 }

+ 1 - 4
src/Console/Exception/MissingHelperException.php

@@ -12,13 +12,10 @@
  */
 namespace Cake\Console\Exception;
 
-use Cake\Core\Exception\Exception;
-
 /**
  * Used when a Helper cannot be found.
  */
-class MissingHelperException extends Exception
+class MissingHelperException extends ConsoleException
 {
-
     protected $_messageTemplate = 'Helper class %s could not be found.';
 }

+ 1 - 3
src/Console/Exception/MissingShellException.php

@@ -12,12 +12,10 @@
  */
 namespace Cake\Console\Exception;
 
-use Cake\Core\Exception\Exception;
-
 /**
  * Used when a shell cannot be found.
  */
-class MissingShellException extends Exception
+class MissingShellException extends ConsoleException
 {
 
     protected $_messageTemplate = 'Shell class for "%s" could not be found. If you are trying to use a plugin shell, that was loaded via $this->addPlugin(), you may need to update bin/cake.php to match https://github.com/cakephp/app/tree/master/bin/cake.php';

+ 1 - 3
src/Console/Exception/MissingShellMethodException.php

@@ -12,12 +12,10 @@
  */
 namespace Cake\Console\Exception;
 
-use Cake\Core\Exception\Exception;
-
 /**
  * Used when a shell method cannot be found.
  */
-class MissingShellMethodException extends Exception
+class MissingShellMethodException extends ConsoleException
 {
 
     protected $_messageTemplate = "Unknown command %1\$s %2\$s.\nFor usage try `cake %1\$s --help`";

+ 1 - 4
src/Console/Exception/MissingTaskException.php

@@ -12,13 +12,10 @@
  */
 namespace Cake\Console\Exception;
 
-use Cake\Core\Exception\Exception;
-
 /**
  * Used when a Task cannot be found.
  */
-class MissingTaskException extends Exception
+class MissingTaskException extends ConsoleException
 {
-
     protected $_messageTemplate = 'Task class %s could not be found.';
 }

+ 0 - 7
src/Console/Exception/StopException.php

@@ -13,7 +13,6 @@
  */
 namespace Cake\Console\Exception;
 
-use Cake\Console\Command;
 use Cake\Core\Exception\Exception;
 
 /**
@@ -25,10 +24,4 @@ use Cake\Core\Exception\Exception;
  */
 class StopException extends Exception
 {
-    /**
-     * Default exception code
-     *
-     * @var int
-     */
-    protected $_defaultCode = Command::CODE_ERROR;
 }