Skip to content

Commit

Permalink
add current_app.logger.exception when running in production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pysalt committed Jan 22, 2020
1 parent ed73520 commit a4bac73
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flask_rest_jsonapi/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def wrapper(*args, **kwargs):
if 'sentry' in current_app.extensions:
current_app.extensions['sentry'].captureException()

if hasattr(current_app, 'logger'):
# todo remove when put sentry to app extensions
current_app.logger.exception('an error occurred in JSONAPI: ')

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

0 comments on commit a4bac73

Please sign in to comment.