// // Created by erki on 16/01/24. // #pragma once #include #include #define TRY(x) ({ \ const auto& _x = (x); \ if (!_x) { \ return std::unexpected(_x.error()); \ } \ _x.value(); \ }) #define TRY_ESP(x) ({ \ const esp_err_t& _x = (x); \ if (_x != ESP_OK) \ return std::unexpected(_x); \ _x; \ })