I am trying to understand errors and exceptions in Tcl. I have written a small code as follows
proc Div3 {a b} {
return [Div2 $a $b]
}
proc Div2 {a b} {
return [Div $a $b]
}
proc Div {a b} {
if {$b == 0} {
error "Error generated by error" "Info String for error" 401
} else {
return [expr $a/$b]
}
}
if {[catch {puts "Result = [Div3 10 0]"} errmsg]} {
puts "ErrorMsg: $errmsg"
puts "ErrorCode: $errorCode"
puts "ErrorInfo:\n$errorInfo\n"
}
when I run this using tclsh.exe
, the debugger output is shown as follows,
% tclsh error-file-1.tcl
ErrorMsg: Error generated by error
ErrorCode: 401
ErrorInfo:
Info String for error
(procedure "Div" line 1)
invoked from within
"Div $a $b"
(procedure "Div2" line 2)
invoked from within
"Div2 $a $b"
(procedure "Div3" line 2)
invoked from within
"Div3 10 0"
However, when I run the same using tclsh.exe
via Komodo IDE, I am getting the debugger output as follows
ErrorMsg: Error generated by error
ErrorCode: 401
ErrorInfo:
Info String for error
invoked from within
"DbgNub_uplevelCmd 1 $cmd"
invoked from within
"Div $a $b"
invoked from within
"DbgNub_uplevelCmd 1 $cmd"
invoked from within
"Div2 $a $b"
invoked from within
"DbgNub_uplevelCmd 1 $cmd"
invoked from within
"Div3 10 0"
invoked from within
"DbgNub_uplevelCmd 1 $cmd"
invoked from within
"DbgNub_Do 0 {1 17 {249 27}} {puts "Result = [DbgNub_Do 1 {1 17 {265 9}} {Div3 10 0}]"}"
I can understand the debugger output from tclsh.exe
but unable to interpret the debugger output from Komodo IDE.
especially, I am unable to understand DbgNub_Do 0 {1 17 {249 27}} {puts "Result = [DbgNub_Do 1 {1 17 {265 9}} {Div3 10 0}]"}
what are the number shown in the lists (i.e {1 17 {249 27}}
) and DbgNub_uplevelCmd 1 $cmd
and DbgNub_Do
Thanks in advance