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
This commit is contained in:
Bruce Momjian 2001-10-04 15:47:41 +00:00
parent 60553337d7
commit 25ec484722

View File

@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS. * ENHANCEMENTS, OR MODIFICATIONS.
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.40 2001/10/01 15:33:31 momjian Exp $ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.41 2001/10/04 15:47:41 momjian Exp $
* *
**********************************************************************/ **********************************************************************/
@ -789,7 +789,11 @@ pltcl_func_handler(PG_FUNCTION_ARGS)
pltcl_restart_in_progress = 1; pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0) if (--pltcl_call_level == 0)
pltcl_restart_in_progress = 0; pltcl_restart_in_progress = 0;
elog(ERROR, "pltcl: %s", interp->result); UTF_BEGIN;
elog(ERROR, "pltcl: %s\n%s", interp->result,
UTF_U2E(Tcl_GetVar(interp,"errorInfo",
TCL_GLOBAL_ONLY)));
UTF_END;
} }
if (--pltcl_call_level == 0) if (--pltcl_call_level == 0)
pltcl_restart_in_progress = 0; pltcl_restart_in_progress = 0;
@ -1162,7 +1166,11 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS)
pltcl_restart_in_progress = 1; pltcl_restart_in_progress = 1;
if (--pltcl_call_level == 0) if (--pltcl_call_level == 0)
pltcl_restart_in_progress = 0; pltcl_restart_in_progress = 0;
elog(ERROR, "pltcl: %s", interp->result); UTF_BEGIN;
elog(ERROR, "pltcl: %s\n%s", interp->result,
UTF_U2E(Tcl_GetVar(interp,"errorInfo",
TCL_GLOBAL_ONLY)));
UTF_END;
} }
if (--pltcl_call_level == 0) if (--pltcl_call_level == 0)
pltcl_restart_in_progress = 0; pltcl_restart_in_progress = 0;