Commit 804d13ad authored by Peter Eisentraut's avatar Peter Eisentraut

Fix behavior when raising plpy.Fatal()

It should cause a elog(FATAL) error, and it fact it was simply causing
a elog(ERROR).

Jan Urbański
parent 8f763243
......@@ -4381,8 +4381,13 @@ PLy_elog(int elevel, const char *fmt,...)
int position = 0;
PyErr_Fetch(&exc, &val, &tb);
if (exc != NULL && PyErr_GivenExceptionMatches(val, PLy_exc_spi_error))
if (exc != NULL)
{
if (PyErr_GivenExceptionMatches(val, PLy_exc_spi_error))
PLy_get_spi_error_data(val, &detail, &hint, &query, &position);
else if (PyErr_GivenExceptionMatches(val, PLy_exc_fatal))
elevel = FATAL;
}
PyErr_Restore(exc, val, tb);
xmsg = PLy_traceback(&xlevel);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment