mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-07 01:54:09 +00:00
Merge pull request #2243 from vilhelmen/write_error_log_fix
Try to create exception str before logging
This commit is contained in:
@@ -103,7 +103,11 @@ class APIHandler(BaseHandler):
|
|||||||
status_message = reason
|
status_message = reason
|
||||||
|
|
||||||
if exception and isinstance(exception, SQLAlchemyError):
|
if exception and isinstance(exception, SQLAlchemyError):
|
||||||
self.log.warning("Rolling back session due to database error %s", exception)
|
try:
|
||||||
|
exception_str = str(exception)
|
||||||
|
self.log.warning("Rolling back session due to database error %s", exception_str)
|
||||||
|
except Exception:
|
||||||
|
self.log.warning("Rolling back session due to database error %s", type(exception))
|
||||||
self.db.rollback()
|
self.db.rollback()
|
||||||
|
|
||||||
self.set_header('Content-Type', 'application/json')
|
self.set_header('Content-Type', 'application/json')
|
||||||
|
Reference in New Issue
Block a user