Skip to content

Commit 804d13a

Browse files
committed
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
1 parent 8f76324 commit 804d13a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/pl/plpython/plpython.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4381,8 +4381,13 @@ PLy_elog(int elevel, const char *fmt,...)
43814381
int position = 0;
43824382

43834383
PyErr_Fetch(&exc, &val, &tb);
4384-
if (exc != NULL && PyErr_GivenExceptionMatches(val, PLy_exc_spi_error))
4385-
PLy_get_spi_error_data(val, &detail, &hint, &query, &position);
4384+
if (exc != NULL)
4385+
{
4386+
if (PyErr_GivenExceptionMatches(val, PLy_exc_spi_error))
4387+
PLy_get_spi_error_data(val, &detail, &hint, &query, &position);
4388+
else if (PyErr_GivenExceptionMatches(val, PLy_exc_fatal))
4389+
elevel = FATAL;
4390+
}
43864391
PyErr_Restore(exc, val, tb);
43874392

43884393
xmsg = PLy_traceback(&xlevel);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy