#[non_exhaustive]pub enum Error {
Show 17 variants
BuildErrors(Vec<Arc<Error>>),
Validation(ValidationError),
Io(Error),
Asset {
kind: &'static str,
source_name: String,
cause: BoxedError,
},
Svg(BoxedError),
Formula(String),
FormulaDiagnostics(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
BuildErrors(Vec<Arc<Error>>)
Ordered diagnostics retained while authoring an invalid value.
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(String)
Formula compiler diagnostics.
FormulaDiagnostics(BoxedError)
Structured formula diagnostics retaining original source ranges.
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 build_errors(&self) -> &[Arc<Error>]
pub fn build_errors(&self) -> &[Arc<Error>]
All deferred authoring diagnostics, preserving their original categories.
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 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()