Helper to log and convert exceptions at the C API boundary.
| 301 | } |
| 302 | // Helper to log and convert exceptions at the C API boundary. |
| 303 | inline WasmEdge_Result handleCAPIError() noexcept { |
| 304 | try { |
| 305 | throw; |
| 306 | } catch (const std::bad_alloc &) { |
| 307 | spdlog::error("C API failed: memory allocation failure"sv); |
| 308 | } catch (const std::exception &E) { |
| 309 | spdlog::error("C API failed: {}"sv, E.what()); |
| 310 | } catch (...) { |
| 311 | spdlog::error("C API failed: unknown exception"sv); |
| 312 | } |
| 313 | return genWasmEdge_Result(ErrCode::Value::RuntimeError); |
| 314 | } |
| 315 | |
| 316 | template <typename T, typename U, typename... CxtT> |
| 317 | inline WasmEdge_Result wrap(T &&Proc, U &&Then, CxtT *...Cxts) noexcept { |
no test coverage detected