clementine_core::errors

Trait ErrorExt

Source
pub trait ErrorExt: Sized {
    // Required methods
    fn into_eyre(self) -> Report;
    fn into_status(self) -> Status;
}
Expand description

Extension traits for errors to easily convert them to eyre::Report and tonic::Status through BridgeError.

Required Methods§

Source

fn into_eyre(self) -> Report

Converts the error into an eyre::Report, first wrapping in BridgeError if necessary. It does not rewrap in eyre::Report if the given error is already an eyre::Report.

Source

fn into_status(self) -> Status

Converts the error into a tonic::Status. Walks the chain of errors and returns the first tonic::Status error. If it can’t find one, it will return an Status::internal with the Display representation of the error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§