/** * Handle exceptions * * This is the global Exception handler that will catch uncaught exceptions * and display a nice-looking page with details about the exception. * * @param Exception $e * @return void */ public static function handleExceptions(Exception $e) { if ($e instanceof SlimStopException === false) { Slim::log(sprintf("Message: %s | File: %s | Line: %d", $e->getMessage(), $e->getFile(), $e->getLine())); if (self::config('debug') === true) { Slim::halt(500, self::generateErrorMarkup($e->getMessage(), $e->getFile(), $e->getLine(), $e->getTraceAsString())); } else { self::error(); } } die; }