Forum OpenACS Development: Re: Any way to get the tcl stack trace from try-catch?

Why not try it and let us know?

Re-throwing a caught error in Tcl is easy, e.g.:

if { [catch {
   Do some stuff that breaks.
} errmsg] } {
   # We caught an unexpected error while the mutex was locked, so
   # unlock the mutex, then re-throw the error:
   ns_mutex unlock $my_mutex
   global errorInfo
   set my_error $errorInfo
   error $my_error
ns_mutex unlock $my_mutex

If you want to log the stack trace but not re-throw the error, look at that $errorInfo stuff. Perhaps Tcl or TclLib provide additional tools for manipulating it.