Error Handling

This description of error handling is divided into two subject groups. One group concerns error messages between the application and the components, and between the components themselves. The other group concerns error messages between systems.

Error Messages from Components

All functions return a standard HRESULT that states whether or not the operation was a success. The standard COM ISupportErrorInfo interface provides additional information about errors.

HRESULT errors from the Navision MS-Message Queue Bus Adapter:

MQBA_E_INTERNALERROR

0x80040200

MQBA_E_REPLYREQ_NO_REPLYQ

0x80040201

MQBA_E_BADREPLYQ

0x80040202

MQBA_E_INSUFFMEM

0x80040203

MQBA_E_BADINTERNAL

0x80040204

MQBA_E_OUTOFBOUNDS

0x80040205

MQBA_E_OUTMSGNOTCREATED

0x80040206

MQBA_E_WRITEQNOTVALID

0x80040207

MQBA_E_NODATATOSEND

0x80040208

MQBA_E_BADINTERNAL_CC_POINTER

0x80040209

Note that the numbers are hexadecimal.

 

Error Messages between Systems

When a message is delivered successfully to the recipient, but an error occurs at the recipient's end when the message is processed, an error message must be sent to the sender of the message. The Navision Communication Component automatically generates this error message using the error information that is returned on the MessageReceived event. This error information can either be returned by the application in the ExceptInfo parameter of the invoke call, or in a separate ErrorInfo object provided by the ISupportErrorInfo interface.

The error information that is provided is used to make an XML document, which contains this information. Here is an example of such an XML document:

<?xml version="1.0" ?>

<NavisionErrorMsg xmlns="urn:www-Navision-com:NavisionErrorMsg.xml">

<ErrorNo> The error number.

<ErrorMessage> The error message text.

<ErrorSource> The application that caused the error.

<BusAdapterId> The ID of the bus adapter that returns the error.

</NavisionErrorMsg>

Note that all the nodes will not necessarily be filled.

When you use the Navision Communication Component with Navision, the ErrorMessage node returns the C/AL error message as text.