Trait hrpc::server::CustomError [−][src]
pub trait CustomError: Debug + Display + Send + Sync {
const DECODE_ERROR: (StatusCode, &'static [u8]);
const NOT_FOUND_ERROR: (StatusCode, &'static [u8]);
const METHOD_NOT_ALLOWED: (StatusCode, &'static [u8]);
const INTERNAL_SERVER_ERROR: (StatusCode, &'static [u8]);
fn code(&self) -> StatusCode;
fn message(&self) -> Vec<u8>;
}
Expand description
Trait that needs to be implemented to use an error type with a generated service server.
Associated Constants
Status code and error body used to respond when a protobuf decode error occurs.
Status code and error body used to respond when a not found error occurs.
Status code and error body used to respond when a method not allowed error occurs.
Status code and error body used to respond when an internal server error occurs.
Required methods
fn code(&self) -> StatusCode
fn code(&self) -> StatusCode
Status code that will be used in client response.