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.
This commit is contained in:
parent
e189d0a96c
commit
e9429324c2
1 changed files with 1 additions and 0 deletions
|
@ -425,6 +425,7 @@ nxt_python_request_handler(nxt_unit_request_info_t *req)
|
||||||
if (nxt_slow_path(iterator == NULL)) {
|
if (nxt_slow_path(iterator == NULL)) {
|
||||||
nxt_unit_req_error(req, "the application returned "
|
nxt_unit_req_error(req, "the application returned "
|
||||||
"not an iterable object");
|
"not an iterable object");
|
||||||
|
PyErr_Print();
|
||||||
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue