/**
  * {@inheritDoc}
  */
 public function handleException(Request $request, HttpException $exception)
 {
     if ($this->isAllowed($exception->getStatusCode())) {
         return $this->kernel->handleException($request, $exception);
     }
     throw $exception;
 }
 /**
  * @param HttpException $e
  * @return string
  */
 protected function getLogLevel(HttpException $e)
 {
     $statusCode = $e->getStatusCode();
     if ($statusCode >= 500) {
         return LogLevel::ERROR;
     } elseif ($statusCode >= 400) {
         return LogLevel::WARNING;
     } else {
         return LogLevel::INFO;
     }
 }
Example #3
0
 /**
  * {@inheritDoc}
  */
 public function handleException(Request $request, HttpException $exception)
 {
     return new Response('', $exception->getStatusCode(), $exception->getHeaders());
 }