/** * The failover stub. Handles the application fault * * @param Exception $e uncaught exception that caused fault * @param Trace $trace handled trace that caused an exception, if built. * @return void */ protected function handle500(Exception $e, Trace $trace = null) { $response = $this->webContext->getResponse(); $response->setStatus(new HttpStatus(HttpStatus::CODE_500)); $clname = get_class($e); $out = <<<EOT \t<h1>Internal Server Error</h1> \t{$clname} : {$e->getMessage()} \t<hr /> \t<h2>Call Stack</h2> \t<pre>{$e->getTraceAsString()}</pre> EOT; $response->write($out)->finish(); if (defined('BUGS_EMAIL')) { $this->notify500(BUGS_EMAIL, $e); } }