/** * If an exception is thrown that is not in a try catch statement it comes * here. It is then output to the screen and code execution stops * * @param Exception $exception */ public static function exceptionHandler($exception) { //if it's not a FrameEx make it one if (!$exception instanceof FrameEx) { $exception = new FrameEx($exception->getMessage(), $exception->getCode(), FrameEx::HIGH, $exception); } try { $exception->process(); } catch (Exception $e) { trigger_error("Error logging exception: " . $e->getMessage()); } //finally echo it out trigger_error($exception->__toString()); }
/** * Process the exception and add it to the current page */ protected function processException(FrameEx $ex) { $ex->process(); $this->view->addException($ex); }