You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
Once the hourly limit is reached I'm starting to get a 403 status (not 429 which is strange, but unrelated) response with no JSON body. The lib is throwing a DecodingError instance from here which is being caught by my catch block and not internally, therefore, it lacks valuable original response data.
Expected Behaviour
DecodingError should be caught and handled here internally. My guess is that getJsonResponse should return Promise.reject(new DecodingError('expected JSON response from server.')); rather than throwing it for the error to be caught by the following catch method in the original Promise chain.
Technical Notes
Stack used:
Node.js: 18.14.0
pnpm: 8.6.6
Next.js: 13.4.8
unsplash-api: 7.0.18
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Steps to Reproduce
createApi
My full code:
Observed Behaviour
Once the hourly limit is reached I'm starting to get a 403 status (not 429 which is strange, but unrelated) response with no JSON body. The lib is throwing a
DecodingError
instance from here which is being caught by mycatch
block and not internally, therefore, it lacks valuable original response data.Expected Behaviour
DecodingError
should be caught and handled here internally. My guess is thatgetJsonResponse
shouldreturn Promise.reject(new DecodingError('expected JSON response from server.'));
rather than throwing it for the error to be caught by the followingcatch
method in the original Promise chain.Technical Notes
Stack used:
The text was updated successfully, but these errors were encountered: