#[non_exhaustive]pub enum Error {
Show 15 variants
Validation(ValidationError),
Io(Error),
Asset {
kind: &'static str,
source_name: String,
cause: BoxedError,
},
Svg(BoxedError),
Formula {
message: String,
source: Option<BoxedError>,
},
Parameters(BoxedError),
Timeline {
timeline: String,
message: String,
},
GpuUnavailable(BoxedError),
Gpu(BoxedError),
DeviceLost(BoxedError),
ScenePanic {
timeline: String,
frame: u64,
message: String,
},
Encoder(BoxedError),
Cancelled,
AtFrame {
frame: u64,
cause: Box<Error>,
},
Other(BoxedError),
}Expand description
Engine failure retaining its original source and optional frame context.
Lower-level geometry APIs still return ValidationError directly. Converting them into this type retains all property/path information. Synchronous scene callbacks still unwind; workers turn caught payloads into ScenePanic.
use motion_core::{Error, ErrorKind};
let error = Error::from(std::io::Error::other("disk failure")).at_frame(12);
assert_eq!(error.kind(), ErrorKind::Io);
assert_eq!(error.frame(), Some(12));
assert!(error.downcast_ref::<std::io::Error>().is_some());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Validation(ValidationError)
Detailed scene/property diagnostic.
Io(Error)
Original filesystem or operating-system error.
Asset
Named resource failure with the original decoder/load error.
Fields
cause: BoxedErrorOriginal failure.
Svg(BoxedError)
SVG parser failure.
Formula
Formula compilation failure, optionally retaining structured diagnostics.
Fields
source: Option<BoxedError>Original structured diagnostics with source ranges, when available.
Parameters(BoxedError)
Invalid serialized project parameters.
Timeline
Timeline construction failure.
GPU setup failure; explicit GPU selection must not silently fall back.
Gpu(BoxedError)
GPU submission/readback failure without a confirmed device-loss callback.
DeviceLost(BoxedError)
Runtime GPU loss with its original driver error.
ScenePanic
Caught scene panic. The message is retained for string payloads.
Fields
Encoder(BoxedError)
Native encoder failure with its original source.
Cancelled
Export was cancelled before destination commit.
AtFrame
An otherwise classified error annotated with a frame index.
Other(BoxedError)
Extension error not covered by a more specific category.
Implementations§
Source§impl Error
impl Error
Sourcepub fn report(&self) -> Option<&ErrorReport>
pub fn report(&self) -> Option<&ErrorReport>
The report of several failures carried by this single error, if any.
Sourcepub fn asset(
kind: &'static str,
source_name: impl Into<String>,
cause: impl StdError + Send + Sync + 'static,
) -> Self
pub fn asset( kind: &'static str, source_name: impl Into<String>, cause: impl StdError + Send + Sync + 'static, ) -> Self
Associates an original failure with a named resource load.
Sourcepub fn formula(message: impl Into<String>) -> Self
pub fn formula(message: impl Into<String>) -> Self
Formula failure without structured diagnostics.
Sourcepub fn formula_with_source(
message: impl Into<String>,
source: impl StdError + Send + Sync + 'static,
) -> Self
pub fn formula_with_source( message: impl Into<String>, source: impl StdError + Send + Sync + 'static, ) -> Self
Formula failure retaining its structured diagnostics as the source.
Sourcepub fn frame(&self) -> Option<u64>
pub fn frame(&self) -> Option<u64>
Frame of failure, if supplied by rendering or a worker boundary.
Sourcepub fn at_frame(self, frame: u64) -> Self
pub fn at_frame(self, frame: u64) -> Self
Attaches a frame without replacing a more specific existing frame. Validation diagnostics keep their original concrete type and fields.
Sourcepub fn downcast_ref<T: StdError + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: StdError + 'static>(&self) -> Option<&T>
Finds an original concrete error through the complete source chain. This preserves property-diagnostic queries without parsing display strings.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()