Trait conjure_error::ErrorType
source · pub trait ErrorType {
// Required methods
fn code(&self) -> ErrorCode;
fn name(&self) -> &str;
fn instance_id(&self) -> Option<Uuid>;
fn safe_args(&self) -> &'static [&'static str];
// Provided method
fn with_instance_id(self, instance_id: Uuid) -> WithInstanceId<Self>
where Self: Sized { ... }
}
Expand description
A trait implemented by Conjure error types.
Required Methods§
sourcefn name(&self) -> &str
fn name(&self) -> &str
Returns the error’s name.
The name must be formatted like NamespaceName:ErrorName
.
sourcefn 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.
Provided Methods§
sourcefn 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.