The preferred way to handle errors inside the e-ADK code is to use one of the throw macros in NNADKMacro.h. The e-ADK provides throw macros that take various arguments, write a string to the log file, and either shut down the adapter or continue, depending on the macro used. NNADKLogging.h must also be included if these macros are used. In any mode, the user can ignore the current message and continue processing by returning TRUE to the Adapter Shell.
This table provides more detailed information about the macros that can be used:
Macro |
Argument |
Logged Info |
Effect on Current Message |
Effect on Processing |
---|---|---|---|---|
NNADK_THROW_CRITICAL |
String |
String |
Sent to the failure transport if one is defined |
e-ADK shuts down |
NNADK_THROW_CRITICAL_USERMESSAGE |
MsgSet MsgIndex |
Using the MsgIndex, a string is retrieved from the indicated catalog file and logged |
Sent to the failure transport if one is defined |
e-ADK shuts down |
NNADK_THROW_CRITICAL_USERMESSAGE_PARAMS |
MsgSet MsgIndex Params |
Using the MsgIndex, a string is retrieved from the indicated catalog file, merged with the Params, and logged. |
Sent to the failure transport if one is defined |
e-ADK shuts down |
NNADK_THROW_WARNING |
String |
String |
Sent to the failure transport if one is defined |
Processing in the e-ADK continues |
NNADK_THROW_WARNING_USER MESSAGE |
MsgSet MsgIndex |
Using the MsgIndex, a string is retrieved from the indicated catalog file and logged |
Sent to the failure transport if one is defined |
Processing in the e-ADK continues |
NNADK_THROW_WARNING_USERMESSAGE_PARAM |
MsgSet MsgIndex |
Using the MsgIndex, a string is retrieved from the indicated catalog file, merged with the Params, and logged |
Sent to the failure transport if one is defined |
Processing in the e-ADK continues |
NNADK_THROW_RETRY |
String |
String |
Message is retried |
Processing in the e-ADK continues |
NNADK_THROW_RETRY_USERMESSAGE |
MsgSet MsgIndex |
Using the MsgIndex, a string is retrieved from the indicated catalog file and logged |
Message is retried |
Processing in the e-ADK continues |
NNADK_THROW_RETRY_USERMESSAGE_PARAMS |
MsgSet MsgIndex Params |
Using the MsgIndex, a string is retrieved from the indicated catalog file, merged with the params, and logged |
Message is retried |
Processing in the e-ADK continues |