L errorinfo: -- error message
If the program is wrong, the TCL parser will give the error back to the application, and the program decides what to do with it. If there are no other measures, the error message will usually be printed on the screen, and this is errorinfo responsible for processing.
L ErrorCode: -- error code
TCL provides another global variable, errorcode, which provides information about the error condition. The format is easily handled by TCL scripts, and it is often used to recover from errors using the Catch command in a TCL script. The errorcode variable contains a list of one or more elements. The first element describes the normal type of error, and other elements provide more information about the type.
L Error : -- wrong display
Tcl errors may be generated by C code or built-in commands that implement the TCL interpreter or by TCL command error, for example:
L catch: -- catch Exception
For example, open a nonexistent file, will be an error:
With the catch command, the error message is not displayed and the program is not terminated.
Catch can accept the second argument: to save an error message
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Tcl Learning-Error | exception