/** * Exception Handler Callback * Rethrows uncatched Exceptions in our presentation style. * * @see http://php.net/manual/de/function.set-exception-handler.php * * @param $exception PHP Exception Objects are valid (Type Hint). */ public function handle(\Exception $exception) { if ($exception->getCode() > 0) { self::fetchExceptionTemplates($exception->getCode()); } echo YellowScreenOfDeath::renderException($exception->getMessage(), $exception->getTraceAsString(), $exception->getCode(), $exception->getFile(), $exception->getLine(), $exception->getTrace()); // we use our own exception handler here, so PHP returns exit code 0. // the execution will stop anyway, but let's return the correct code. \Koch\Tools\ApplicationQuit::quit(255); }
public function render($exception) { YellowScreenOfDeath::renderException($this->exception->getMessage(), $this->exception->getTraceAsString(), $this->exception->getCode(), $this->exception->getFile(), $this->exception->getLine(), $this->exception->getTrace()); }