19#define ERROR(msg, errc) \
22 DEBUGFN(msg << " (0x" << hex << uppercase << errc << dec \
23 << nouppercase << ')'); \
39#define ERROR(msg, errc) \
41 DEBUGFN(msg << " (0x" << hex << uppercase << errc << dec \
42 << nouppercase << ')'); \
57#define FATAL_ERROR(msg, errc) \
60 DEBUGFN(F("Fatal Error: ") << msg << " (0x" << hex << uppercase \
61 << errc << dec << nouppercase << ')'); \
72class ErrorException :
public std::exception {
74 ErrorException(
const std::string message,
int errorCode)
75 : message(std::move(message)), errorCode(errorCode) {}
76 const char *what()
const throw()
override {
return message.c_str(); }
77 int getErrorCode()
const {
return errorCode; }
80 const std::string message;
86#define ERROR(msg, errc) \
89 std::ostringstream s; \
90 s << DEBUG_FUNC_LOCATION << msg; \
91 throw ErrorException(s.str(), errc); \
94#define FATAL_ERROR(msg, errc) \
97 std::ostringstream s; \
98 s << DEBUG_FUNC_LOCATION << msg; \
99 throw ErrorException(s.str(), errc); \
void fatalErrorExit() __attribute__((noreturn))
Function that executes and loops forever, blinking the built-in LED when a fatal error is encountered...
#define BEGIN_AH_NAMESPACE