Error Handler for Cake console. Does simple printing of the exception that occurred and the stack trace of the error.
__construct( array $options [] )
Constructor
$options
optional [] _displayError( array $error , boolean $debug )
Prints an error to stderr.
Template method of BaseErrorHandler.
$error
$debug
_displayException( Exception $exception )
Prints an exception to stderr.
$exception
_stop( integer $code )
Stop the execution and set the exit code for the process.
$code
Cake\Error\BaseErrorHandler::_stop()
handleException( Exception $exception )
Handle errors in the console environment. Writes errors to stderr, and logs messages if Configure::read('debug') is false.
$exception
Exception
Cake\Error\BaseErrorHandler::handleException()
_getMessage( Exception $exception )
Generates a formatted error message
$exception
string
_logError( string $level , array $data )
Log an error.
$level
$data
boolean
_logException( Exception $exception )
Handles exception logging
$exception
boolean
handleError( integer $code , string $description , string|null $file null , integer|null $line null , array|null $context null )
Set as the default error handler by CakePHP.
Use config/error.php to customize or replace this error handler. This function will use Debugger to display errors when debug > 0. And will log errors to Log, when debug == 0.
You can use the 'errorLevel' option to set what type of errors will be handled. Stack traces for errors can be enabled with the 'trace' option.
$code
$description
$file
optional null $line
optional null $context
optional null boolean
handleFatalError( integer $code , string $description , string $file , integer $line )
Display/Log a fatal error.
$code
$description
$file
$line
boolean
mapErrorCode( integer $code )
Map an error code into an Error word, and log location.
$code
array
wrapAndHandleException( Exception|Error $exception )
Checks the passed exception type. If it is an instance of Error
then, it wraps the passed object inside another Exception object for backwards compatibility purposes.
$exception
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Console.ConsoleErrorHandler.html