Error handling consists mainly of two default library routines defined in the tclutil package: one for normal errors and one for system related errors that should include the system error text:
error(const char* msg1, const char* msg2, int code = 0); sys_error(const char* msg1, const char* msg2);
These routines are defaults that can be overridden by the application if they are defined there. The default versions for Tcl applications generate Tcl errors while the default versions for plain C/C++ applications print the messages on the stderr.
In any case, the error reporting routines keep a copy of the most recent error message, which can be retrieved using the getError() routine/method.
Set a routine to be called when errors occur and return a pointer to the previous handler. |
|
Simple default error handler: print the error message on stdout. |
See the man page for error(3) in the tclutil package for details on the above routines.
Please send questions or comments to abrighto@eso.org@eso.org.
Copyright © 1998 ESO - European Southern Observatory