summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-23 05:21:04 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:23 -0500
commit8f9478b09d39d8c13871684a6af3d3e1629a0e84 (patch)
tree282e9f837fa18e9c5e7d26049cfb2818c1c6bfa9 /source4/scripting/ejs
parenta92e61c4528b46628275216c9252a7a7f6e07dfc (diff)
downloadsamba-8f9478b09d39d8c13871684a6af3d3e1629a0e84.tar.gz
samba-8f9478b09d39d8c13871684a6af3d3e1629a0e84.tar.bz2
samba-8f9478b09d39d8c13871684a6af3d3e1629a0e84.zip
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)
Diffstat (limited to 'source4/scripting/ejs')
-rw-r--r--source4/scripting/ejs/smbscript.c8
1 files changed, 6 insertions, 2 deletions
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;