C++ overloaded error checking functions `try` is keyword, `_try` is reserved in msvc
| 19 | /// C++ overloaded error checking functions |
| 20 | /// `try` is keyword, `_try` is reserved in msvc |
| 21 | void _Try(const char *Name, const WasmEdge_Result &R) { |
| 22 | if (not WasmEdge_ResultOK(R)) { |
| 23 | throw std::runtime_error{ |
| 24 | fmt::format("{}: {}", Name, WasmEdge_ResultGetMessage(R))}; |
| 25 | } |
| 26 | } |
| 27 | template <typename T> T *_Try(const char *Name, T *R) { |
| 28 | if (R == nullptr) { |
| 29 | throw std::runtime_error{Name}; |
no test coverage detected