summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2019-11-14 17:48:48 +0300
committerValentin Bartenev <vbart@nginx.com>2019-11-14 17:48:48 +0300
commite9429324c218942ba05fa586cd139c81a94e2b66 (patch)
tree8976985893d638564b2797b0065d52de35e46530
parente189d0a96c4020adca73f8fcff04255b6c9a1c5a (diff)
downloadunit-e9429324c218942ba05fa586cd139c81a94e2b66.tar.gz
unit-e9429324c218942ba05fa586cd139c81a94e2b66.tar.bz2
Python: improved error handling if response object isn't iterable.
According to the documentation, PyObject_GetIter(): | Raises TypeError and returns NULL if the object cannot be iterated. Previously, this exception wasn't printed or cleared and remained unhandled.
-rw-r--r--src/nxt_python_wsgi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nxt_python_wsgi.c b/src/nxt_python_wsgi.c
index e95d4898..7c4a94f1 100644
--- a/src/nxt_python_wsgi.c
+++ b/src/nxt_python_wsgi.c
@@ -425,6 +425,7 @@ nxt_python_request_handler(nxt_unit_request_info_t *req)
if (nxt_slow_path(iterator == NULL)) {
nxt_unit_req_error(req, "the application returned "
"not an iterable object");
+ PyErr_Print();
goto fail;
}