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) { $errorConfig = Configure::read('Error'); if (isset($errorConfig['level']) && ($code & ~$errorConfig['level'])) { return; } $stderr = self::getStderr(); list($name, $log) = self::_mapErrorCode($code); $stderr->write(sprintf( __("%s Error: %s in [%s, line %s]\n"), $name, $description, $file, $line )); } /** * undocumented function * * @return void */ public function render() { $this->stderr->write(sprintf( __("Error: %s\n%s"), $this->error->getMessage(), $this->error->getTraceAsString() )); } }