From 8f9478b09d39d8c13871684a6af3d3e1629a0e84 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 23 Aug 2005 05:21:04 +0000 Subject: r9504: use some low level ejs hackery to give much better exception error messages in both the web server and smbscript. We can now give backtraces for all internal asserts, not just high level errors (This used to be commit 84c756b25ccb2bd75360bdb9b7b7643975d1f3b3) --- source4/scripting/ejs/smbscript.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/scripting/ejs') diff --git a/source4/scripting/ejs/smbscript.c b/source4/scripting/ejs/smbscript.c index b16536a575..a35b988e56 100644 --- a/source4/scripting/ejs/smbscript.c +++ b/source4/scripting/ejs/smbscript.c @@ -24,17 +24,21 @@ #include "includes.h" #include "dynconfig.h" #include "lib/appweb/ejs/ejs.h" +#include "lib/appweb/ejs/ejsInternal.h" #include "scripting/ejs/smbcalls.h" +static EjsId eid; + void ejs_exception(const char *reason) { - fprintf(stderr, "smbscript exception: %s", reason); + Ejs *ep = ejsPtr(eid); + ejsSetErrorMsg(eid, "%s", reason); + fprintf(stderr, "%s", ep->error); exit(127); } int main(int argc, const char **argv) { - EjsId eid; EjsHandle handle = 0; MprVar result; char *emsg, *script; -- cgit