Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 25ec484

Browse files
committed
This patch adds reporting of tcl global variable errorInfo
which contains stack trace. One problem, after this patch errors will generate multiline ERROR messages. Is it acceptable or do I need split it and generate multiple singleline messages? Vsevolod Lobko
1 parent 6055333 commit 25ec484

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/pl/tcl/pltcl.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* ENHANCEMENTS, OR MODIFICATIONS.
3232
*
3333
* IDENTIFICATION
34-
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.40 2001/10/01 15:33:31 momjian Exp $
34+
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.41 2001/10/04 15:47:41 momjian Exp $
3535
*
3636
**********************************************************************/
3737

@@ -789,7 +789,11 @@ pltcl_func_handler(PG_FUNCTION_ARGS)
789789
pltcl_restart_in_progress = 1;
790790
if (--pltcl_call_level == 0)
791791
pltcl_restart_in_progress = 0;
792-
elog(ERROR, "pltcl: %s", interp->result);
792+
UTF_BEGIN;
793+
elog(ERROR, "pltcl: %s\n%s", interp->result,
794+
UTF_U2E(Tcl_GetVar(interp,"errorInfo",
795+
TCL_GLOBAL_ONLY)));
796+
UTF_END;
793797
}
794798
if (--pltcl_call_level == 0)
795799
pltcl_restart_in_progress = 0;
@@ -1162,7 +1166,11 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS)
11621166
pltcl_restart_in_progress = 1;
11631167
if (--pltcl_call_level == 0)
11641168
pltcl_restart_in_progress = 0;
1165-
elog(ERROR, "pltcl: %s", interp->result);
1169+
UTF_BEGIN;
1170+
elog(ERROR, "pltcl: %s\n%s", interp->result,
1171+
UTF_U2E(Tcl_GetVar(interp,"errorInfo",
1172+
TCL_GLOBAL_ONLY)));
1173+
UTF_END;
11661174
}
11671175
if (--pltcl_call_level == 0)
11681176
pltcl_restart_in_progress = 0;

0 commit comments

Comments
 (0)