write(sprintf(
__("Error: %s\n%s"),
$exception->getMessage(),
$exception->getTraceAsString()
));
}
/**
* Handle errors in the console environment.
*
* @return void
*/
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
if (error_reporting() === 0) {
return;
}
$stderr = self::getStderr();
list($name, $log) = self::_mapErrorCode($code);
$message = sprintf(__('%s in [%s, line %s]'), $description, $file, $line);
$stderr->write(sprintf(__("%s Error: %s\n"), $name, $message));
if (Configure::read('debug') == 0) {
App::import('Core', 'CakeLog');
CakeLog::write($log, $message);
}
}
/**
* undocumented function
*
* @return void
*/
public function render() {
$this->stderr->write(sprintf(
__("Error: %s\n%s"),
$this->error->getMessage(),
$this->error->getTraceAsString()
));
}
}