-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: add error handling for limit errors #210
Conversation
73ed509
to
a95f1ef
Compare
6d79ba4
to
569d212
Compare
569d212
to
89ee52f
Compare
const errors = response?.body?.errors; | ||
|
||
if (isJsonApiErrors(errors)) { | ||
jsonApiError = errors[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
: This behaviour (only handling first error) is not documented anywhere.
I don't see cases where we have more than one error from the API TBH, but know the JSON API requires arrays.
If someone were to change the API to actually return more than one error they will probably not realise the client can only handle one though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess this is a limitation right now, where would you think we can document it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The good thing is if we have more than 1 error, nothing breaks. They will be ignored.
Perhaps a single comment from the service that throws the error?
🎉 This PR is included in version 4.23.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What does this PR do?
Screenshots