wasmerio/wasmer · error

is_from_store is only implemented for the sys backend

Error message

is_from_store is only implemented for the sys backend

What it means

Exception::is_from_store checks whether the exception belongs to the given store, but the enum wrapper only dispatches for the sys backend; other backends panic with unimplemented!().

Source

Thrown at lib/api/src/entities/exception/inner.rs:46

                let BackendTag::Sys(tag) = &tag.0 else {
                    panic!("cannot create Exception with Tag from another backend");
                };

                Self::Sys(crate::backend::sys::exception::Exception::new(
                    store, tag, payload,
                ))
            }
            _ => unimplemented!("new is only implemented for the sys backend"),
        }
    }

    /// Checks whether this `Exception` can be used with the given store.
    #[inline]
    pub fn is_from_store(&self, store: &impl AsStoreRef) -> bool {
        match self {
            #[cfg(feature = "sys")]
            Self::Sys(s) => s.is_from_store(store),
            _ => unimplemented!("is_from_store is only implemented for the sys backend"),
        }
    }

    /// Gets the exception tag.
    #[inline]
    pub fn tag(&self, store: &impl AsStoreRef) -> Tag {
        match self {
            #[cfg(feature = "sys")]
            Self::Sys(s) => Tag(BackendTag::Sys(s.tag(store))),
            _ => unimplemented!("tag is only implemented for the sys backend"),
        }
    }

    /// Gets the exception payload values.
    #[inline]
    pub fn payload(&self, store: &mut impl AsStoreMut) -> Vec<Value> {
        match self {
            #[cfg(feature = "sys")]

View on GitHub (pinned to 8c4b9ee9d3)

Solutions

  1. Only call exception APIs under the sys backend
  2. Wrap the check in a backend feature check before invoking
  3. Avoid storing/moving Exception values across backends
  4. Extend the wrapper to implement is_from_store for other backends
Defensive patterns

Strategy: validation

Validate before calling

if !exceptions_supported(&store) { return Err(...); } // check backend == Sys first

Type guard

fn is_sys_exception(ex: &ExceptionInner) -> bool {
    matches!(ex, ExceptionInner::Sys(_))
}

Try / catch

let ok = std::panic::catch_unwind(|| exn.is_from_store(&store)).unwrap_or(false);

Prevention

When it happens

Trigger: Calling Exception::is_from_store(store) on an Exception whose variant is not Sys, i.e. on any non-sys backend build where an exception value exists.

Common situations: Validation code that checks store ownership before using exception values; code shared across backends where only sys supports exceptions.

Related errors


AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01). Data as JSON: /api/errors/24565e1ed0304b73. Report an issue: GitHub.