-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Improving SDK error/response handling #19539
Conversation
🦋 Changeset detectedLatest commit: 4564527 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Very nice 🚀
@br41nslug Should we consider this a breaking change? |
Hmm, the error output could definitely be a breaking change for those relying on the error structure as it was 🤔 |
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
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.
Tested the latest state ✅
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.
LGTM 👍
* improving error/response handling * updated request function to expose the response on error * updated the composables where needed * Create few-rules-talk.md * ran prettier * undid unintended type change * added missing awaits for onResponse * Update few-rules-talk.md * Mark it as major change * unpack directus errors instead of nesting * ran prettier * Update .changeset/few-rules-talk.md Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch> --------- Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Fixes #19304
Added the response object in the thrown error for any request if the error is one returned from Directus.
Added the original request object to the
onResponse(result, request)
handler