Skip to content

Commit 8f76324

Browse files
committed
Report Python errors from iterators with PLy_elog
This improves reporting, as the error string now includes the actual Python exception. As a side effect, this no longer sets the errcode to ERRCODE_DATA_EXCEPTION, which might be considered a feature, as it's not documented and not clear why iterator errors should be treated differently. Jan Urbański
1 parent cfcdc99 commit 8f76324

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/pl/plpython/plpython.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,9 +1157,7 @@ PLy_function_handler(FunctionCallInfo fcinfo, PLyProcedure *proc)
11571157
PLy_function_delete_args(proc);
11581158

11591159
if (has_error)
1160-
ereport(ERROR,
1161-
(errcode(ERRCODE_DATA_EXCEPTION),
1162-
errmsg("error fetching next item from iterator")));
1160+
PLy_elog(ERROR, "error fetching next item from iterator");
11631161

11641162
/* Disconnect from the SPI manager before returning */
11651163
if (SPI_finish() != SPI_OK_FINISH)

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