[tcljava-user] Stack trace from scrpits
Brought to you by:
mdejong
From: Michael T. A. <mt...@so...> - 2000-12-01 12:23:51
|
When a tcl script fails with an error, errorInfo is printed by the native Tcl shell (and Tcl blend) but not by Jacl. This script shows the difference if you first run it with tclsh and then with jaclsh (replace tclsh with jaclsh) test.tcl: ===== #!/bin/sh # Restart using a Tcl shell \ exec tclsh "$0" "$@" catch {error hello1} puts errorCode=$errorCode puts errorInfo=$errorInfo puts "not handled exception:" error hello2 --------------------------------------------------------------- I think this patch solves the problem: $ diff Shell.java Shell.java.org 111,117c111 < try { < System.err.println(interp.getVar("errorInfo", null, TCL.GLOBAL_ONLY).toString()); < } < catch (TclException ex) { < // I guess this will never happen < System.err.println(interp.getResult().toString()); < } --- > System.err.println(interp.getResult().toString()); Regards, Michael Tulinius Andersen Softility.dk |