/**
  * Hook from set_exception_handler(). Will clear output data, set the HTTP status to 500: Internal Error
  * and then die.
  *
  * @param \Exception $ex The uncaught exception
  */
 public static function lastChanceExceptionHandler($ex)
 {
     Logger::alert("Last chance exception handler fired.", null, $ex);
     $response = new Response();
     $response->setPrivate();
     $response->setStatusCode(500, "Unhandled internal server exception.");
     $response->send();
 }