Skip to content

Commit a4bac73

Browse files
committed
add current_app.logger.exception when running in production mode
1 parent ed73520 commit a4bac73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

flask_rest_jsonapi/decorators.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def wrapper(*args, **kwargs):
8383
if 'sentry' in current_app.extensions:
8484
current_app.extensions['sentry'].captureException()
8585

86+
if hasattr(current_app, 'logger'):
87+
# todo remove when put sentry to app extensions
88+
current_app.logger.exception('an error occurred in JSONAPI: ')
89+
8690
exc = JsonApiException(getattr(e,
8791
'detail',
8892
current_app.config.get('GLOBAL_ERROR_MESSAGE') or str(e)),

0 commit comments

Comments
 (0)