Skip to main content

Error

Enum Error 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§kind: &'static str

Resource category, such as image, font or model.

§source_name: String

User-facing resource identifier or source path.

§cause: BoxedError

Original failure.

§

Svg(BoxedError)

SVG parser failure.

§

Formula

Formula compilation failure, optionally retaining structured diagnostics.

Fields

§message: String

User-facing explanation.

§source: Option<BoxedError>

Original structured diagnostics with source ranges, when available.

§

Parameters(BoxedError)

Invalid serialized project parameters.

§

Timeline

Timeline construction failure.

Fields

§timeline: String

Timeline identifier.

§message: String

Violated timing contract.

§

GpuUnavailable(BoxedError)

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

§timeline: String

Registered scene or timeline name.

§frame: u64

Requested frame index.

§message: String

Panic payload text, or a non-string-payload marker.

§

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.

Fields

§frame: u64

Requested frame index.

§cause: Box<Error>

Original classified error.

§

Other(BoxedError)

Extension error not covered by a more specific category.

Implementations§

Source§

impl Error

Source

pub fn report(&self) -> Option<&ErrorReport>

The report of several failures carried by this single error, if any.

Source

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.

Source

pub fn formula(message: impl Into<String>) -> Self

Formula failure without structured diagnostics.

Source

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.

Source

pub fn kind(&self) -> ErrorKind

Classifies an error independently of any frame annotation.

Source

pub fn frame(&self) -> Option<u64>

Frame of failure, if supplied by rendering or a worker boundary.

Source

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.

Source

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.

Source

pub fn scene_panic( timeline: impl Into<String>, frame: u64, payload: Box<dyn Any + Send>, ) -> Self

Classifies a caught scene panic while preserving its scene and frame.

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn StdError + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Box<dyn Error + Sync + Send>> for Error

Source§

fn from(error: BoxedError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ErrorReport

Source§

fn from(error: Error) -> Self

Converts to this type from the input type.
Source§

impl From<ErrorReport> for Error

Source§

fn from(report: ErrorReport) -> Self

Converts to this type from the input type.
Source§

impl From<RecvError> for Error

Source§

fn from(error: RecvError) -> Self

Converts to this type from the input type.
Source§

impl From<TryFromSliceError> for Error

Source§

fn from(error: TryFromSliceError) -> Self

Converts to this type from the input type.
Source§

impl From<TryReserveError> for Error

Source§

fn from(error: TryReserveError) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for Error

Source§

fn from(error: Utf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<ValidationError> for Error

Source§

fn from(error: ValidationError) -> Self

Converts to this type from the input type.
Source§

impl From<VarError> for Error

Source§

fn from(error: VarError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Forget for Error

§

impl Freeze for Error

§

impl Move for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.