/** * @param Error $error * @return string */ function format(Error $error) { // Combine message and stack trace into a more readable form with left margins. $margin = ' '; $message = $error->getMessage(); $trigger = $margin . ' → ' . $error->getTriggerFile() . ' (' . $error->getTriggerLine() . ')'; $stackTrace = preg_replace("/\n/", "\n" . $margin, $margin . $error->getStackTraceAsString()); isset($this->path) && ($stackTrace = str_replace($this->path, '', $stackTrace)); return $message . "\n" . $trigger . "\n" . $stackTrace; }
/** * @param Exception $exception */ public function __construct(Exception $exception) { $this->setException($exception); parent::__construct(); }