Example #1
0
 public static function handler(Exception $exception)
 {
     try {
         if (Config::getInstance()->debug === true) {
             if (!((get_class($exception) == 'Ajde_Exception' || is_subclass_of($exception, 'Ajde_Exception')) && !$exception->traceOnOutput())) {
                 Ajde_Exception_Log::logException($exception);
                 echo self::trace($exception);
             } else {
                 Ajde_Exception_Log::logException($exception);
                 Ajde_Http_Response::redirectServerError();
             }
         } else {
             Ajde_Exception_Log::logException($exception);
             Ajde_Http_Response::redirectServerError();
         }
     } catch (Exception $exception) {
         error_log(self::trace($exception, self::EXCEPTION_TRACE_LOG));
         die("An uncatched exception occured within the error handler, see the server error_log for details");
     }
 }