Boboter
Loading...
Searching...
No Matches
error.h File Reference
#include <source_location>
#include <esp_err.h>

Go to the source code of this file.

Macros

#define ERROR_CHECK(expr)
 Checks if the given expression failed and aborts if so.
#define WARN_CHECK(expr)
 Checks if the given expression failed and warns if so.

Functions

void error_check_callback (const char *tag, esp_err_t expr, std::source_location loc=std::source_location::current())
 Checks if the given expression failed and aborts if so.
void warn_check_callback (const char *tag, esp_err_t expr, std::source_location loc=std::source_location::current())
 Checks if the given expression failed and warns if so.

Detailed Description

Authors
MarioS271

Macro Definition Documentation

◆ ERROR_CHECK

#define ERROR_CHECK ( expr)
Value:
void error_check_callback(const char *tag, const esp_err_t expr, const std::source_location loc)
Checks if the given expression failed and aborts if so.
Definition error.cpp:11

Checks if the given expression failed and aborts if so.

Note
Wrapper for error_check_callback
Attention
This macro requires TAG to be defined in the scope where it is used. If it isn't, please directly use error_check_callback
Parameters
exprThe expression to check

◆ WARN_CHECK

#define WARN_CHECK ( expr)
Value:
void warn_check_callback(const char *tag, const esp_err_t expr, const std::source_location loc)
Checks if the given expression failed and warns if so.
Definition error.cpp:26

Checks if the given expression failed and warns if so.

Note
Wrapper for warn_check_callback
Attention
This macro requires TAG to be defined in the scope where it is used. If it isn't, please directly use warn_check_callback
Parameters
exprThe expression to check

Function Documentation

◆ error_check_callback()

void error_check_callback ( const char * tag,
esp_err_t expr,
std::source_location loc = std::source_location::current() )

Checks if the given expression failed and aborts if so.

Parameters
tagThe tag to use when logging
exprThe expression to check

◆ warn_check_callback()

void warn_check_callback ( const char * tag,
esp_err_t expr,
std::source_location loc = std::source_location::current() )

Checks if the given expression failed and warns if so.

Parameters
tagThe tag to use when logging
exprThe expression to check