MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / _Try

Function _Try

test/api/APIAOTNestedVMTest.cpp:21–26  ·  view source on GitHub ↗

C++ overloaded error checking functions `try` is keyword, `_try` is reserved in msvc

Source from the content-addressed store, hash-verified

19/// C++ overloaded error checking functions
20/// `try` is keyword, `_try` is reserved in msvc
21void _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}
27template <typename T> T *_Try(const char *Name, T *R) {
28 if (R == nullptr) {
29 throw std::runtime_error{Name};

Callers 2

wrapMethod · 0.85
wrapMethod · 0.85

Calls 2

WasmEdge_ResultOKFunction · 0.85

Tested by

no test coverage detected