Skip to content

Commit

Permalink
Updated exception code handling for ajax requests
Browse files Browse the repository at this point in the history
  • Loading branch information
L3RAZ committed Oct 25, 2024
1 parent 17d1d0d commit cc3d1ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/front/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,9 @@ private function handleException(Exception $exception)
'body' => [
'error' => [
'message' => $exceptionMessageForCustomer,
'code' => $exception->getCode(),
'code' => (int) $exception->getCode() < 400 && $exception->getPrevious() !== null
? (int) $exception->getPrevious()->getCode()
: (int) $exception->getCode(),
],
],
'exceptionCode' => $exception->getCode(),
Expand Down

0 comments on commit cc3d1ad

Please sign in to comment.