Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-json errors from REST api cause Fatal Errors #22

Open
drekinov opened this issue Jun 12, 2024 · 0 comments
Open

non-json errors from REST api cause Fatal Errors #22

drekinov opened this issue Jun 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@drekinov
Copy link

Hi,

related to recent servers error and one currently going on https://status.nordigen.com/incidents/w000r4t5mry6.

src/Http/RequestHandlerTrait.php handle BadResponseException which can be Client or Server side error.
In src/Http/RequestHandlerTrait.php#L41 api response is always processed as JSON and passed to getExceptionType which expects array.

 $json = json_decode($content, true);
 $errorType = self::getExceptionType($json);

private static function getExceptionType(array $response)

in case of 502 from load balancer or any other layer not handled by backend django rest framework . it can be NULL because Accept headers are not handled properly. that lead to php errors in sdk and Nordigen API errors are hidden and applications cannot properly handle outages.

Our Sentry is full of php errors instead of nordigen api errors that service return.

@drekinov drekinov added the bug Something isn't working label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant