Python: respond with 500 in case of a coroutine error.

If a coroutine throws an exception, respond with a 500
after logging the exception itself.
This commit is contained in:
Joris Vink 2020-06-30 09:57:48 +02:00
parent 2316f1016d
commit 122a86013b
1 changed files with 6 additions and 0 deletions

View File

@ -990,6 +990,12 @@ python_coro_run(struct python_coro *coro)
Py_XDECREF(traceback);
} else {
kore_python_log_error("coroutine");
if (coro->request != NULL) {
http_response(coro->request,
HTTP_STATUS_INTERNAL_ERROR,
NULL, 0);
}
}
coro_running = NULL;