Error Handler for Cake console. Does simple printing of the exception that occurred and the stack trace of the error.
Handle errors in the console environment. Writes errors to stderr, and logs messages if Configure::read('debug') is false.
__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
Cake\Error\BaseErrorHandler::handleException()
_getMessage( Exception $exception )
Generates a formatted error message
$exception
_logError( string $level , array $data )
Log an error.
$level
$data
_logException( Exception $exception )
Handles exception logging
$exception
_requestContext( Cake\Http\ServerRequest $request )
Get the request context for an error/exception trace.
Cake\Http\ServerRequest
$request
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 handleFatalError( integer $code , string $description , string $file , integer $line )
Display/Log a fatal error.
$code
$description
$file
$line
increaseMemoryLimit( integer $additionalKb )
Increases the PHP "memory_limit" ini setting by the specified amount in kilobytes
$additionalKb
mapErrorCode( integer $code )
Map an error code into an Error word, and log location.
$code
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–2017 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.
https://api.cakephp.org/3.4/class-Cake.Console.ConsoleErrorHandler.html