mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[fix] Correctly handle error 500 (#142)
* [fix] Correctly handle error 500 * [fix] Remove unwanted change in error_to_response
This commit is contained in:
parent
e0a50487ec
commit
8960b1a610
1 changed files with 9 additions and 0 deletions
|
@ -387,6 +387,15 @@ class _ActionsMapPlugin(object):
|
||||||
ret = self.actionsmap.process(arguments, timeout=30, route=_route)
|
ret = self.actionsmap.process(arguments, timeout=30, route=_route)
|
||||||
except MoulinetteError as e:
|
except MoulinetteError as e:
|
||||||
raise error_to_response(e)
|
raise error_to_response(e)
|
||||||
|
except Exception as e:
|
||||||
|
if isinstance(e, HTTPResponse):
|
||||||
|
raise e
|
||||||
|
import traceback
|
||||||
|
tb = traceback.format_exc()
|
||||||
|
logs = { "route": _route,
|
||||||
|
"arguments": arguments,
|
||||||
|
"traceback": tb }
|
||||||
|
return HTTPErrorResponse(json_encode(logs))
|
||||||
else:
|
else:
|
||||||
return format_for_response(ret)
|
return format_for_response(ret)
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Add table
Reference in a new issue