Class ConsoleErrorHandler
Error Handler for Cake console. Does simple printing of the exception that occurred and the stack trace of the error.
Package: Cake\Console
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Console/ConsoleErrorHandler.php
Copyright: Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
License: License (http://www.opensource.org/licenses/mit-license.php)
Location: Cake/Console/ConsoleErrorHandler.php
Properties summary
-
$stderr
public staticStandard error stream.
Method Summary
-
_stop() protected
Wrapper for exit(), used for testing. -
getStderr() public static
Get the stderr object for the console error handling. -
handleError() public
Handle errors in the console environment. Writes errors to stderr, and logs messages if Configure::read('debug') is 0.
-
handleException() public
Handle a exception in the console environment. Prints a message to stderr.
Method Detail
_stop() protected ¶
_stop( $code = 0 )
Wrapper for exit(), used for testing.
Parameters
- $code optional 0
- The exit code.
handleError() 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 $file optional null
- The file the error occurred in.
- integer $line optional null
- The line the error occurred on.
- array $context optional null
- The backtrace of the error.
handleException() public ¶
handleException( Exception $exception )
Handle a exception in the console environment. Prints a message to stderr.
Parameters
- Exception $exception
- The exception to handle