{"record":{"id":"baa33c6dc2910a3f","repo":"wasmerio/wasmer","slug":"vm-exceptionref-is-only-implemented-for-the-sys-ba","errorCode":null,"errorMessage":"vm_exceptionref is only implemented for the sys backend","messagePattern":"vm_exceptionref is only implemented for the sys backend","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/api/src/entities/exception/inner.rs","lineNumber":76,"sourceCode":"    }\n\n    /// Gets the exception payload values.\n    #[inline]\n    pub fn payload(&self, store: &mut impl AsStoreMut) -> Vec<Value> {\n        match self {\n            #[cfg(feature = \"sys\")]\n            Self::Sys(s) => s.payload(store),\n            _ => unimplemented!(\"payload is only implemented for the sys backend\"),\n        }\n    }\n\n    /// Get the `VMExceptionRef` corresponding to this `Exception`.\n    #[inline]\n    pub fn vm_exceptionref(&self) -> VMExceptionRef {\n        match self {\n            #[cfg(feature = \"sys\")]\n            Self::Sys(s) => VMExceptionRef::Sys(s.exnref()),\n            _ => unimplemented!(\"vm_exceptionref is only implemented for the sys backend\"),\n        }\n    }\n\n    /// Creates a new `Exception` from a `VMExceptionRef`.\n    #[inline]\n    pub fn from_vm_exceptionref(exnref: VMExceptionRef) -> Self {\n        match exnref {\n            #[cfg(feature = \"sys\")]\n            VMExceptionRef::Sys(s) => {\n                Self::Sys(crate::backend::sys::exception::Exception::from_exnref(s))\n            }\n            _ => unimplemented!(\"from_vm_exceptionref is only implemented for the sys backend\"),\n        }\n    }\n}\n","sourceCodeStart":58,"sourceCodeEnd":92,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/api/src/entities/exception/inner.rs#L58-L92","documentation":"Exception::vm_exceptionref yields the raw VMExceptionRef for engine interop, dispatching only to the sys variant; other backends panic with unimplemented!().","triggerScenarios":"Calling Exception::vm_exceptionref() when converting exceptions into VM-level representations (e.g. rethrowing, cross-boundary propagation) on a non-sys backend.","commonSituations":"Embedding layers that trap/rethrow wasm exceptions internally; engine interop glue written against the sys backend.","solutions":["Use the sys backend wherever vm_exceptionref is required","Remove raw VMExceptionRef paths from backend-agnostic code","Feature-gate the interop code to the sys backend","Implement vm_exceptionref for the remaining backends"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if !exceptions_supported(&store) { return Err(...); } // backend must be Sys","typeGuard":"fn is_sys_exception(ex: &ExceptionInner) -> bool {\n    matches!(ex, ExceptionInner::Sys(_))\n}\n","tryCatchPattern":"let exn_ref = std::panic::catch_unwind(|| exn.vm_exceptionref()).ok();","preventionTips":["Isolate raw VMExceptionRef usage in sys-gated modules","Do not propagate exceptions across engines without backend checks","Keep engine-interop layers per-backend instead of sharing them"],"tags":["wasm","exception-handling","unimplemented","backend-support"],"backgroundTag":"feature-only-sys-backend","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}