Exemplo n.º 1
0
 /**
  * Creates exception response
  *
  * @param \Exception $exception
  */
 public function getExceptionResponse(\Exception $exception)
 {
     $this->add($exception);
     // only set status code if default - allows controllers to overwrite
     if ($this->response->getStatusCode() == Response::HTTP_OK) {
         $code = $exception instanceof HttpExceptionInterface ? $exception->getStatusCode() : Response::HTTP_BAD_REQUEST;
         $this->response->setStatusCode($code);
     }
     return $this->send();
 }
Exemplo n.º 2
0
 /**
  * Creates exception response
  *
  * @param \Exception $exception
  */
 public function getExceptionResponse(\Exception $exception)
 {
     $this->add($exception);
     $this->response->setStatusCode(400);
     return $this->send();
 }