Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function handleException(Request $request, HttpException $exception)
 {
     if ($this->isAllowed($exception->getStatusCode())) {
         return $this->kernel->handleException($request, $exception);
     }
     throw $exception;
 }
Пример #2
0
 /**
  * @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;
     }
 }
Пример #3
0
 /**
  * {@inheritDoc}
  */
 public function handleException(Request $request, HttpException $exception)
 {
     return new Response('', $exception->getStatusCode(), $exception->getHeaders());
 }