-
Notifications
You must be signed in to change notification settings - Fork 292
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
Invalid handling of exceptions different from ValidationError #1140
Comments
Thanks for raising this issue. Indeed the current DJA error handling mainly handles ValidationError. In this case however it is a custom exception of simplejwt where DJA then thinks code and detail are field names which is not the case. To address this issue the error handling logic needs to be rewritten that it handles ValidationError and other errors differently. |
I also run in an equivalent behavior. If i raise an error like described in the docs, the above behavior will occurs. My workaround was to pass in an array with the error object. |
Description of the Bug Report
The current error handling assumes that each field in the error exception dictionary is a field name. This is only true for ValidationException though but not for other exception such as InvalidToken as in example below.
Error handling needs to be adjusted so ValidationException and other errors are handled different.
Orginal report
Checklist
The text was updated successfully, but these errors were encountered: