/**
  * @inheritdoc
  */
 public static function exitWithException(\Exception $e, $message = 'WebApplication encountered an error.')
 {
     // if we have code set in exception we respond with that as http status code, else 500 it is.
     $httpCode = $e->getCode();
     $httpCode = isset($httpCode) ? $httpCode : 500;
     http_response_code($httpCode);
     parent::exitWithException($e, $message);
 }