Skip to main content

IntoErrorCode

Trait IntoErrorCode 

Source
pub trait IntoErrorCode {
    // Required methods
    fn error_code(&self) -> ErrorCode;
    fn message(&self) -> String;
}
Expand description

Trait for converting errors to protocol-agnostic error codes.

Implement this for your error types, or use the derive macro.

Required Methods§

Source

fn error_code(&self) -> ErrorCode

Get the error code for this error

Source

fn message(&self) -> String

Get a human-readable message

Implementations on Foreign Types§

Source§

impl IntoErrorCode for Error

Implementors§