Error Handling
Runtime errors in the RXF are handled by the error
handler
.
The error handler will catch runtime errors like the lack of resources,
etc.
The error handler function is called from several places in the
Framework, the first argument
indicates the error that occurred, the second parameter is not always
used but for instance
in case of an RTOS failure, the RTOS error code is passed here.
The third parameter "returnAllowed" can be used to decide if the
software can recover from that error after application specific error
handling or if the error is expected to require a shutdown or reboot.
But the final decision which errors are handled in which way can only
be decided with application knowledge by the developer.
The example implementation of the operation
RXF::ErrorHandler::error() is implemented
as an endless loop in the source file RXF_ErrorHandler.cpp, if "returnAllowed" is false. Otherwise it just returns.
It is strongly
advised to provide an own error handler
implementation which fits your application needs.
The recommended way to modify the error handler is using the error handler Standard Content of the RXF:
- Create a new RXFErrorHandler package by right clicking the
project or an existing package and from the "RXF" profile select
"RXFErrorHandler":
- Modify the Implementation of RXF_ErrorHandler::error() to fit your needs.
If it is necessary to catch the Error of unconsumed events
directly in a reactive class, before the error handler is called the
operation handleNotConsumed can be overridden for a reactive class.
The operation can have the OXF compatible signature
void handleNotConsumed(IOxfEvent* ev,EventNotConsumedReason reason)
but will be corrected to the RXF compatible signature by the simplifier
void handleNotConsumed(const Event* const event);
Error Codes
The error codes are available in the file RXF_ErrorCodes.h along with a comment as explanation.