Trait conjure_error::ErrorType
source · [−]pub trait ErrorType {
fn code(&self) -> ErrorCode;
fn name(&self) -> &str;
fn instance_id(&self) -> Option<Uuid>;
fn safe_args(&self) -> &'static [&'static str];
fn with_instance_id(self, instance_id: Uuid) -> WithInstanceId<Self>
where
Self: Sized,
{ ... }
}Expand description
A trait implemented by Conjure error types.
Required methods
Returns the error’s name.
The name must be formatted like NamespaceName:ErrorName.
fn instance_id(&self) -> Option<Uuid>
fn instance_id(&self) -> Option<Uuid>
Returns the error’s instance ID, if it stores one.
Conjure-generated error types return None, but other implementations like those for SerializableError
and WithInstanceId return a value.
fn safe_args(&self) -> &'static [&'static str]
fn safe_args(&self) -> &'static [&'static str]
Returns a sorted slice of the names of the error’s safe parameters.
Provided methods
fn with_instance_id(self, instance_id: Uuid) -> WithInstanceId<Self> where
Self: Sized,
fn with_instance_id(self, instance_id: Uuid) -> WithInstanceId<Self> where
Self: Sized,
Wraps the error in another that overrides its instance ID.