|
@@ -52,12 +52,12 @@ |
|
|
block discarded – undo |
|
52
|
52
|
ApiResponse $api_response, |
|
53
|
53
|
?Throwable $previous = null |
|
54
|
54
|
): AbstractApiException | Error { |
|
55
|
|
- return match ($api_response->getStatus()) { |
|
56
|
|
- 401 => new UnauthorizedApiException(previous: $previous), |
|
57
|
|
- 403 => new InaccessibleResourceException(previous: $previous), |
|
58
|
|
- 404 => new EntityNotFoundException(previous: $previous), |
|
59
|
|
- 422 => new MalformedPayloadException(previous: $previous, errors: $api_response->getData()), |
|
60
|
|
- default => new Error(message: "Undefined error", code: 1000, previous: $previous), |
|
|
55
|
+ return match($api_response->getStatus()) { |
|
|
56
|
+ 401 => new UnauthorizedApiException(previous : $previous), |
|
|
57
|
+ 403 => new InaccessibleResourceException(previous : $previous), |
|
|
58
|
+ 404 => new EntityNotFoundException(previous : $previous), |
|
|
59
|
+ 422 => new MalformedPayloadException(previous : $previous, errors : $api_response->getData()), |
|
|
60
|
+ default => new Error(message : "Undefined error", code : 1000, previous : $previous), |
|
61
|
61
|
}; |
|
62
|
62
|
} |
|
63
|
63
|
} |
Please login to merge, or discard this patch.