Exemplo n.º 1
0
 /**
  * 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());
 }