[tcljava-user] JACL 1.4 - no line numbers on error.
Brought to you by:
mdejong
From: Patrick F. <fin...@gm...> - 2007-09-07 06:50:53
|
I had a look at some of the threads on the comp.lang.tcl newsgroup and it seems that "catch" destroys the error location information when the stack unwinds http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/4dd1c0a1eba12999/840020cf40ca2f9f?lnk=gst&q=%2B%22error%22%2B%22catch%22&rnum=6#840020cf40ca2f9f The recommendation is to throw an error after the catch to trigger the stack trace but I find that in Jacl "return -code error $r" does not generate the error information. E.G if { [ catch { $AdminConfig yabba } r ] == 0 } { set donothing true } else { return -code error $r } gives............... WASX7017E: Exception received while running file "C:\home\patrick\eclipse\WASAdminSBV\WSAdmin\WAS6.1\JACL\installCluster.tcl"; exception information: com.ibm.bsf.BSFException: error while eval'ing Jacl expression: no accessible method "yabba" in class com.ibm.ws.scripting.AdminConfigClient invoked from within "::installCluster::installCluster $propertiesFile " I found that one way to trigger a full error stack is to insert an invalid command option. if { [ catch { $AdminConfig yabba } r ] == 0 } { set donothing true } else { "return -code error $r $::errorInfo $::errorCode" } gives.................... WASX7017E: Exception received while running file "C:\home\patrick\eclipse\WASAdminSBV\WSAdmin\WAS6.1\JACL\installCluster.tcl"; exception information: com.ibm.bsf.BSFException: error while eval'ing Jacl expression: bad option "no accessible method "yabba" in class com.ibm.ws.scripting.AdminConfigClient": must be -code, -errorcode, or -errorinfo while executing "return -code error $r $::errorInfo $::errorCode" ("if" else script line 5) invoked from within "if { [ catch { $AdminConfig yabba } r ] == 0 } { set donothing true } else { #return -code error $r re..." (procedure "::installCluster::installCluster" line 28) invoked from within "::installCluster::installCluster $propertiesFile " Is there a better way to preserve the error location information when using nested catches? |