/CakePHP 2.7

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 (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Located at Cake/Console/ConsoleErrorHandler.php

Method Detail

_stopsource protected

_stop( integer $code 0 )

Wrapper for exit(), used for testing.


integer $code optional 0
The exit code.

getStderrsource public static

getStderr( )

Get the stderr object for the console error handling.



handleErrorsource 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.


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.

handleExceptionsource public

handleException( Exception $exception )

Handle an exception in the console environment. Prints a message to stderr.


Exception $exception
The exception to handle

Properties summary


public static ConsoleOutput

Standard error stream.

© 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.