Detect errors

The functions described previously in this chapter might only fail upon class container mismatch, for example if you try to call xibrt_setBoolean on a container that holds a class S value. In such a situation, the call is aborted and no action is performed at all: neither value retrieval, nor container update.

If you write your Custom Functions carefully, that kind of error should not happen. Since you define the classes for all arguments to your Custom Functions, you always know the exact type of data held by containers.

To keep the integration engine runtime services library API as simple as possible, error detection is not carried by the call themselves (no error code returned). To know about the last call status, just call the following function:

/* Last call status */
int xibrt_getLastStatus(xibrt_handle hCtx);

This call returns one of the following values:

Value Circumstances
XIBRT_SUCCESSFULL The previous call was completely successful
XIBRT_CLASSMISMATCH The call operates on a container with an appropriate class
XIBRT_NULLVALUE Attempt to retrieve value from a container containing null
XIBRT_ABSENTVALUE Attempt to retrieve value from a container containing absent

Each call overwrites the last status: if you missed an error detection, the result is lost.

Related Links