Skip to content

Commit

Permalink
add global error message for uncached errors
Browse files Browse the repository at this point in the history
  • Loading branch information
akira-dev committed Jul 10, 2018
1 parent 4c307de commit 1ad33ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flask_rest_jsonapi/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def dispatch_request(self, *args, **kwargs):
if 'sentry' in current_app.extensions:
current_app.extensions['sentry'].captureException()

exc = JsonApiException(getattr(e, 'detail', str(e)),
exc = JsonApiException(getattr(e,
'detail',
current_app.config.get('GLOBAL_ERROR_MESSAGE') or str(e)),
source=getattr(e, 'source', ''),
title=getattr(e, 'title', None),
status=getattr(e, 'status', None),
Expand Down

0 comments on commit 1ad33ed

Please sign in to comment.