Beispiel #1
0
 public static function handleException($e, $context = null)
 {
     if ($e instanceof Exception\HttpException) {
         $httpHandler = Suricate::Error()->httpHandler;
         if (is_object($httpHandler) && $httpHandler instanceof \Closure) {
             $httpHandler($e);
             return;
         } elseif ($httpHandler != '') {
             $httpHandler = explode('::', $httpHandler);
             if (count($httpHandler) > 1) {
                 call_user_func($httpHandler, $e);
             } else {
                 call_user_func(head($httpHandler), $e);
             }
             return;
         }
         Suricate::Error()->displayGenericHttpExceptionPage($e);
     }
     while (ob_get_level() > 1) {
         ob_end_clean();
     }
     /**
             TODO : put error in logger
     */
     Suricate::Error()->displayGenericExceptionPage($e, $context);
 }