-
Notifications
You must be signed in to change notification settings - Fork 299
Add code to error object if ErrorDetail
has code
#700
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
Conversation
Codecov Report
@@ Coverage Diff @@ ## master #700 +/- ## ======================================= Coverage 95.97% 95.97% ======================================= Files 54 54 Lines 2735 2735 ======================================= Hits 2625 2625 Misses 110 110
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@ ## master #700 +/- ## ======================================= Coverage 95.97% 95.97% ======================================= Files 54 54 Lines 2735 2735 ======================================= Hits 2625 2625 Misses 110 110
Continue to review full report at Codecov.
|
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.
Nice work and a great improvement! Thanks.
Uh oh!
There was an error while loading. Please reload this page.
Description of the Change
JSON:API specification allows for a
code
value in the error object. This PR copies thecode
inside theErrorDetail
from rest_framework'sAPIException
into the JSON:API error object. Allowing users of the library to send application-specific error codes back to the clients by specifying a code alongside the detail when raising anAPIException
Checklist
CHANGELOG.md
updated (only for user relevant changes)AUTHORS