exceptions: skip extracting exception by deprecated .message attribute
This commit is contained in:
parent
6ad53fbb40
commit
257c91a1ad
3 changed files with 3 additions and 3 deletions
|
|
@ -137,7 +137,7 @@ def exception_view(exc, request):
|
|||
rpc_id = getattr(request, 'rpc_id', None)
|
||||
|
||||
if isinstance(exc, JSONRPCError):
|
||||
fault_message = safe_str(exc.message)
|
||||
fault_message = safe_str(exc)
|
||||
log.debug('json-rpc error rpc_id:%s "%s"', rpc_id, fault_message)
|
||||
elif isinstance(exc, JSONRPCValidationError):
|
||||
colander_exc = exc.colander_exception
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ def cleanup_sessions(request, apiuser, older_then=Optional(60)):
|
|||
older_than_seconds=older_than_seconds)
|
||||
return {'sessions_removed': cleaned, 'backend': backend}
|
||||
except user_sessions.CleanupCommand as msg:
|
||||
return {'cleanup_command': msg.message, 'backend': backend}
|
||||
return {'cleanup_command': str(msg), 'backend': backend}
|
||||
except Exception as e:
|
||||
log.exception('Failed session cleanup')
|
||||
raise JSONRPCError(
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class AdminSessionSettingsView(BaseAppView):
|
|||
older_than_seconds=older_than_seconds)
|
||||
h.flash(_('Cleaned up old sessions'), category='success')
|
||||
except user_sessions.CleanupCommand as msg:
|
||||
h.flash(msg.message, category='warning')
|
||||
h.flash(str(msg), category='warning')
|
||||
except Exception as e:
|
||||
log.exception('Failed session cleanup')
|
||||
h.flash(_('Failed to cleanup up old sessions'), category='error')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue