Go up one levelGo to Previous Go to Next

Error Handling

Error handling in the C++ code consists of a collection library routines, described in error(3) , and a facility for specifying an error handler routine to be called to report errors. The error reporting routines keep a copy of the most recent error message, which can be retrieved using the getError () routine. In Tcl based applications, these routines normally generate Tcl error messages in the main interpreter, while in non-Tcl applications, the default action is to print the error messages on stderr. The TclCommand(3) class automatically defines an error handler for Tcl.

C++ Error Reporting Routines

Routine

Description

error

Report the error.

fmt_error

Same as error , but with a printf like interface.

sys_error

Report the error with the system error code, like perror.

fmt_sys_error

same as sys_error , but with a printf like interface.

log_message

Used to log a message that is not an error (not used here).

last_error

Return the text of the previous error message.

last_error_code

Return the error code for the previous error.

clear_error

Reset the last_error buf to empty.

set_error_handler

Set a routine to be called when errors occur and return a pointer to the previous handler.

print_error

Simple default error handler: print the error message on stdout.

 


Go up one levelGo to Previous Go to Next

Please send questions or comments to abrighto@eso.org.
Copyright © 1998 ESO - European Southern Observatory