diff options
Diffstat (limited to 'gn3/errors.py')
-rw-r--r-- | gn3/errors.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gn3/errors.py b/gn3/errors.py index 7a97228..e9056d4 100644 --- a/gn3/errors.py +++ b/gn3/errors.py @@ -84,18 +84,16 @@ def handle_sqlite3_errors(exc: OperationalError): def handle_sparql_errors(exc): """Handle sqlite3 errors if not handled anywhere else.""" current_app.logger.error("Handling sparql errors", exc_info=True) - current_app.logger.error(exc) - __code = { - EndPointInternalError: 500, - EndPointNotFound: 400, - QueryBadFormed: 400, - Unauthorized: 401, - URITooLong: 414, + code = { + "EndPointInternalError": 500, + "EndPointNotFound": 404, + "QueryBadFormed": 400, + "Unauthorized": 401, + "URITooLong": 414, } return jsonify({ "error": exc.msg, - "error_description": str(exc), - }), __code.get(exc) + }), code.get(exc.__class__.__name__) def handle_generic(exc: Exception) -> Response: |