Skip to content

Commit

Permalink
check for exception code if is valid response code before setting res…
Browse files Browse the repository at this point in the history
…ponse code
  • Loading branch information
dakorpar committed Sep 16, 2021
1 parent af143cb commit c65534c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ protected function process(): ?BaseResponse

return null;
} catch (ResponseException $responseException) {
$this->getHttpResponse()->setCode($responseException->getCode());
if ($responseException->getCode() >= 100 && $responseException->getCode() < 600) {
$this->getHttpResponse()->setCode($responseException->getCode());
}

$result = $responseException instanceof ValidationException
? new ValidationErrorResponse($responseException)
Expand Down

0 comments on commit c65534c

Please sign in to comment.