mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
debug: print stacktrace to stderr upon 500 errors, because otherwise APIs are hell to debug ~_~
This commit is contained in:
parent
924fd7825e
commit
d53dfc2997
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import re
|
||||
import errno
|
||||
import logging
|
||||
|
@ -471,6 +471,7 @@ class _ActionsMapPlugin:
|
|||
|
||||
tb = traceback.format_exc()
|
||||
logs = {"route": _route, "arguments": arguments, "traceback": tb}
|
||||
print(tb, file=sys.stderr)
|
||||
return HTTPResponse(json_encode(logs), 500)
|
||||
else:
|
||||
return format_for_response(ret)
|
||||
|
|
Loading…
Reference in a new issue