We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 57eb234 + d6d3f3e commit 835c00eCopy full SHA for 835c00e
rest_framework_json_api/exceptions.py
@@ -29,6 +29,12 @@ def exception_handler(exc, context):
29
# see if they passed a dictionary to ValidationError manually
30
if isinstance(error, dict):
31
errors.append(error)
32
+ # or a string in case of AuthenticationError
33
+ elif isinstance(error, str):
34
+ # An error MUST be a JSON object in JSON API spec
35
+ errors.append({
36
+ 'detail': error
37
+ })
38
else:
39
if isinstance(error, list):
40
for message in error:
0 commit comments