On this page
Class ConsoleErrorHandler
Error Handler for Cake console. Does simple printing of the exception that occurred and the stack trace of the error.
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Location: Cake/Console/ConsoleErrorHandler.php
Properties summary
- Standard error stream.
Method Summary
- 
    _stop() protectedWrapper for exit(), used for testing.
- Get the stderr object for the console error handling.
- 
    handleError() publicHandle errors in the console environment. Writes errors to stderr, and logs messages if Configure::read('debug') is 0. 
- 
    handleException() publicHandle an exception in the console environment. Prints a message to stderr.
Method Detail
_stop()source protected
_stop( integer $code 0 )Wrapper for exit(), used for testing.
Parameters
- 
     integer $codeoptional 0
- The exit code.
getStderr()source public static
getStderr( )Get the stderr object for the console error handling.
Returns
ConsoleOutputhandleError()source public
handleError( integer $code , string $description , string $file null , integer $line null , array $context null )Handle errors in the console environment. Writes errors to stderr, and logs messages if Configure::read('debug') is 0.
Parameters
- 
     integer $code
- Error code
- 
     string $description
- Description of the error.
- 
     string $fileoptional null
- The file the error occurred in.
- 
     integer $lineoptional null
- The line the error occurred on.
- 
     array $contextoptional null
- The backtrace of the error.
handleException()source public
handleException( Exception|ParserError $exception )Handle an exception in the console environment. Prints a message to stderr.
Parameters
- 
     Exception|ParserError $exception
- The exception to handle
Properties detail
© 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/2.10/class-ConsoleErrorHandler.html