/**
  * @param HTTPRequestResponseContainer $httpRequestResponse
  */
 public function onRequest(HTTPRequestResponseContainer $httpRequestResponse)
 {
     try {
         $routingResponse = $this->router->route($httpRequestResponse->getRequest());
         $this->dispatchRoutingResponseFilter($routingResponse, $httpRequestResponse);
     } catch (\Exception $e) {
         if ($e->getCode() == 404) {
             //This is the fallback "not found" handler. The routing itself can also route to the 404 handler.
             $routingResponse = $this->router->getNotFoundRoute();
         } else {
             $routingResponse = $this->router->getServerErrorRoute();
             $parameters = array_merge(['exception' => $e], $routingResponse->getParameters());
             $routingResponse = new RoutingResponse($routingResponse->getStatusCode(), $routingResponse->getClass(), $routingResponse->getMethod(), $parameters);
         }
         $this->dispatchRoutingResponseFilter($routingResponse, $httpRequestResponse);
     }
 }