diff --git a/app/errors.py b/app/errors.py index 67448e1fb..09ff8d633 100644 --- a/app/errors.py +++ b/app/errors.py @@ -111,5 +111,8 @@ def register_errors(blueprint): @blueprint.app_errorhandler(500) @blueprint.errorhandler(Exception) def internal_server_error(e): + # if e is a werkzeug InternalServerError then it may wrap the original exception. For more details see: + # https://flask.palletsprojects.com/en/1.1.x/errorhandling/?highlight=internalservererror#unhandled-exceptions + e = getattr(e, 'original_exception', e) current_app.logger.exception(e) return jsonify(result='error', message="Internal server error"), 500 diff --git a/requirements-app.txt b/requirements-app.txt index b72629c26..f628c38e6 100644 --- a/requirements-app.txt +++ b/requirements-app.txt @@ -15,7 +15,7 @@ gunicorn==19.7.1 # pyup: ignore, >19.8 breaks eventlet patching iso8601==0.1.12 jsonschema==3.0.2 marshmallow-sqlalchemy==0.17.0 -marshmallow==3.0.1 +marshmallow==2.20.2 # pyup: <3 throws errors psycopg2-binary==2.8.3 PyJWT==1.7.1 SQLAlchemy==1.3.8 diff --git a/requirements.txt b/requirements.txt index 62c4af0b6..b74c9de73 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ gunicorn==19.7.1 # pyup: ignore, >19.8 breaks eventlet patching iso8601==0.1.12 jsonschema==3.0.2 marshmallow-sqlalchemy==0.17.0 -marshmallow==3.0.1 +marshmallow==2.20.2 # pyup: <3 throws errors psycopg2-binary==2.8.3 PyJWT==1.7.1 SQLAlchemy==1.3.8