Skip to main content

DetailedError

Trait DetailedError 

Source
pub trait DetailedError: StdError + Serialize {
    // Required method
    fn error_code(&self) -> Cow<'static, str>;

    // Provided method
    fn log_level(&self) -> Level { ... }
}
Expand description

Error trait which internal errors must implement such that it can be transformed to a complete JSON error response.

An error that is also an HTTP response, an actix ResponseError, converts to an ErrorResponse that is logged by its status code.

Required Methods§

Source

fn error_code(&self) -> Cow<'static, str>

Identifying name of the error.

Provided Methods§

Source

fn log_level(&self) -> Level

The level to log the error at.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§