diff --git a/crates/smlib/src/core.rs b/crates/smlib/src/core.rs index a6ead218a..f1c367652 100644 --- a/crates/smlib/src/core.rs +++ b/crates/smlib/src/core.rs @@ -176,15 +176,15 @@ pub(crate) fn run(call: &'static str, f: impl FnOnce(&mut Kernel) -> std::res } } -/// A call the capi checks for `SM_SUCCESS`, treating any other status as no answer: an SMLib -/// status (solidcore's [`SolidError::Upstream`](solidcore::SolidError::Upstream), or NLib's -/// [`SolidError::Nlib`](solidcore::SolidError::Nlib)) is `None`. Every other solidcore error +/// A call the capi checks for `SM_SUCCESS`, treating any other status as no answer: an error +/// that stands for an SMLib status exactly ([`SolidError::sm_status`](solidcore::SolidError::sm_status), +/// solidcore#1452) is `None`. Every other solidcore error /// (unported code, invalid input to an adapter, a missing record...) is not a status the C++ /// path returns, so it fails the call instead of hiding as a skipped entity. pub(crate) fn answer(r: std::result::Result) -> std::result::Result, solidcore::SolidError> { match r { Ok(v) => Ok(Some(v)), - Err(solidcore::SolidError::Upstream { .. } | solidcore::SolidError::Nlib { .. }) => Ok(None), + Err(e) if e.sm_status().is_some() => Ok(None), Err(e) => Err(e), } }