Skip to main content

EffectError

Trait EffectError 

Source
pub trait EffectError:
    StdError
    + TraceRawVcs
    + NonLocalValue
    + Send
    + Sync
    + 'static { }
Expand description

The error type that an effect can return. We use dyn std::error::Error (instead of anyhow::Error or SharedError) to encourage use of structured error types that can potentially be transformed into Issues.

We can’t require that the returned error implements Issue:

  • Issue uses FileSystemPath
  • turbo-tasks-fs returns effect errors that should be transformed into Issues.
  • It logically doesn’t make sense to define Issue in turbo-tasks-fs, Issue can’t be defined in a base crate either because it would form a circular crate dependency.

So instead, we leave it up to the caller to figure out how to downcast these errors themselves.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> EffectError for T
where T: StdError + TraceRawVcs + NonLocalValue + Send + Sync + 'static,