32 lines
1.4 KiB
Plaintext
32 lines
1.4 KiB
Plaintext
USING: errors help ;
|
|
|
|
HELP: error f
|
|
{ $description "Global variable holding most-recently thrown error." }
|
|
{ $notes "Only updated by " { $link throw } ", not " { $link rethrow } "." } ;
|
|
|
|
HELP: error-continuation f
|
|
{ $description "Global variable holding current continuation of most-recently thrown error." }
|
|
{ $notes "Only updated by " { $link throw } ", not " { $link rethrow } "." } ;
|
|
|
|
HELP: :s "( -- )"
|
|
{ $description "Prints the datastack at the time of the most recent error. Used for interactive debugging." } ;
|
|
|
|
HELP: :r "( -- )"
|
|
{ $description "Prints the callstack at the time of the most recent error. Used for interactive debugging." } ;
|
|
|
|
HELP: :get "( variable -- value )"
|
|
{ $values { "variable" "an object" } { "value" "the value, or f" } }
|
|
{ $description "Looks up the value of a variable at the time of the most recent error." } ;
|
|
|
|
HELP: error. "( error -- )"
|
|
{ $values { "error" "an error" } }
|
|
{ $contract "Print an error to the default stream." } ;
|
|
|
|
HELP: print-error "( error -- )"
|
|
{ $values { "error" "an error" } }
|
|
{ $description "Print an error to the default stream. This word gets called by the listener and other tools which report caught errors to the user. You can define methods on this generic word for custom error reporting." } ;
|
|
|
|
HELP: try "( quot -- )"
|
|
{ $values { "quot" "a quotation" } }
|
|
{ $description "Calls the quotation. If it throws an error, logs the error to the default stream and restores the datastack." } ;
|