Exception: Teek::TclError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Teek::TclError
- Defined in:
- lib/teek.rb,
ext/teek/tcltkbridge.c
Overview
Raised on a Tcl error (TCL_ERROR) from #tcl_eval, #tcl_invoke, or
anything built on them. message is the same short one-line Tcl
result this exception has always carried; #tcl_backtrace and
#tcl_error_code additionally expose Tcl's own +errorInfo+/+errorCode+
for the failing call - captured immediately after the failing
Tcl_Eval/Tcl_EvalObjv via Tcl_GetReturnOptions, before anything else
can run and disturb them. Both are nil for the handful of Ruby-level
guard errors (e.g. "interpreter has been deleted") that never actually
reached Tcl.
Instance Attribute Summary collapse
-
#tcl_backtrace ⇒ String?
readonly
Tcl's
errorInfofor the failing call - a multi-line trace with a "while executing"/"invoked from within" frame for each level of Tcl proc call the error unwound through. -
#tcl_error_code ⇒ String?
readonly
Tcl's
errorCodefor the failing call (a Tcl list, typically "NONE" unless the failing command set one explicitly).
Instance Method Summary collapse
-
#initialize(message, tcl_backtrace = nil, tcl_error_code = nil) ⇒ TclError
constructor
private
A new instance of TclError.
Constructor Details
#initialize(message, tcl_backtrace = nil, tcl_error_code = nil) ⇒ TclError
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of TclError.
61 62 63 64 65 |
# File 'lib/teek.rb', line 61 def initialize(, tcl_backtrace = nil, tcl_error_code = nil) super() @tcl_backtrace = tcl_backtrace @tcl_error_code = tcl_error_code end |
Instance Attribute Details
#tcl_backtrace ⇒ String? (readonly)
Returns Tcl's errorInfo for the failing call - a
multi-line trace with a "while executing"/"invoked from within"
frame for each level of Tcl proc call the error unwound through.
54 55 56 |
# File 'lib/teek.rb', line 54 def tcl_backtrace @tcl_backtrace end |
#tcl_error_code ⇒ String? (readonly)
Returns Tcl's errorCode for the failing call (a Tcl
list, typically "NONE" unless the failing command set one explicitly).
58 59 60 |
# File 'lib/teek.rb', line 58 def tcl_error_code @tcl_error_code end |