Skip to main content

ErrorStatusConversionExt

Trait ErrorStatusConversionExt 

Source
pub trait ErrorStatusConversionExt: ErrorCode {
    // Required method
    fn status_code(&self) -> Code;
}
Expand description

Extension trait for mapping error codes to gRPC status codes.

This trait should be implemented alongside ErrorCode to define how your greenlight-specific errors map to standard gRPC status codes.

Required Methods§

Source

fn status_code(&self) -> Code

Maps this error to an appropriate gRPC status code.

The returned status code should follow gRPC conventions: See: https://grpc.io/docs/guides/status-codes/

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§