pub enum FcError {
InvalidInput {
message: String,
},
Unsupported {
message: String,
},
OutOfBounds {
message: String,
},
}Expand description
The structured error every crate in the workspace returns across the boundary.
A String across a WASM boundary loses the distinction between “the user
typed something invalid” and “we have a bug”, and those need different
handling at each end. This is serialized rather than thrown so the JS side
can branch on kind without string matching.
Variants§
InvalidInput
Well-formed but semantically invalid, e.g. a range with end before start. Usually the caller’s fault and worth surfacing to the user.
Unsupported
Cannot be satisfied in the current state, e.g. undo on an empty history. Expected in normal operation.
OutOfBounds
An index outside the bounds of a document or model. Indicates a bug, so it is logged rather than displayed.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FcError
impl<'de> Deserialize<'de> for FcError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FcError
impl RefUnwindSafe for FcError
impl Send for FcError
impl Sync for FcError
impl Unpin for FcError
impl UnsafeUnpin for FcError
impl UnwindSafe for FcError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more