Variables

Detailed Description

When a function fails, brlapi_errno will hold an error code to explain why it failed. It should always be reported somehow.

Although most errors are reported that way, some (called exceptions) are reported asynchronously for efficiency reasons, because they always just report a programming error. The affected functions are: brlapi_setFocus, brlapi_write* and brlapi_sendRaw. When they happen, the next call to brlapi_something will close the connection and call the exception handler. If the exception handler returns, the brlapi_something function will return an end-of-file error.

The default exception handler (brlapi_defaultExceptionHandler()) dumps the guilty packet before abort()ing. It can be replaced by calling brlapi_setExceptionHandler(). For instance, the Java and Python bindings use this for raising a Java or Python exception that may be caught.

Types of exception handlers which are to be given to brlapi_setExceptionHandler() and brlapi__setExceptionHandler().

Parameters:

handle is the handle corresponding to the guilty connection;
error is a BRLAPI_ERROR_ error code;
type is the type of the guilty packet;
packet points to the content of the guilty packet (might be a little bit truncated);
size gives the guilty packet's size.