kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 122a86013b363bf94dbdfe7cb4c397519ccc9b10
parent 2316f1016dcc7d6acbc7674897384837f857626f
Author: Joris Vink <joris@coders.se>
Date:   Tue, 30 Jun 2020 09:57:48 +0200

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.

Diffstat:
src/python.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/python.c b/src/python.c @@ -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;