iceoryx_hoofs 2.0.3
|
This handler is needed for unit testing, special debugging cases and other corner cases where we'd like to explicitly suppress the error handling. More...
#include <iceoryx_hoofs/error_handling/error_handling.hpp>
Static Public Member Functions | |
static cxx::GenericRAII | setTemporaryErrorHandler (const HandlerFunction &newHandler) noexcept |
static const char * | toString (const Error error) noexcept |
Static Protected Member Functions | |
static void | reactOnErrorLevel (const ErrorLevel level, const char *errorText) noexcept |
Friends | |
void | errorHandler (const Error error, const std::function< void()> &errorCallBack, const ErrorLevel level) noexcept |
Howto use the error handler correctly 1.) If the error you would like to handle is not listed in ICEORYX_ERRORS(error)... macro just add them like: error(MODULE_NAME__MY_FUNKY_ERROR) Attention: Create an error after the following convention: MODULE_NAME__A_CLEAR_BUT_SHORT_ERROR_DESCRIPTION And a long name is alright! More... | |
This handler is needed for unit testing, special debugging cases and other corner cases where we'd like to explicitly suppress the error handling.
|
friend |
Howto use the error handler correctly 1.) If the error you would like to handle is not listed in ICEORYX_ERRORS(error)... macro just add them like: error(MODULE_NAME__MY_FUNKY_ERROR) Attention: Create an error after the following convention: MODULE_NAME__A_CLEAR_BUT_SHORT_ERROR_DESCRIPTION And a long name is alright!
2.) Call errorHandler(Error::kMODULE_NAME__MY_FUNKY_ERROR); Please pay attention to the "k" prefix The defaults for errorCallback and ErrorLevel can also be overwritten: errorHandler( Error::kMODULE_NAME__MY_FUNKY_ERROR, []{ std::cout << "MyCustomCallback" << std::endl; }, ErrorLevel::MODERATE );