pub enum ApiError {
Unavailable {
reason: String,
},
CeremonyNotFound {
ceremony_id: String,
},
Conflict {
what: String,
},
Refused {
reason: String,
},
}Expand description
How this contract fails.
Four shapes, because a consumer acts differently on each: waiting is a
remedy for Unavailable, asking for something else is the remedy for
CeremonyNotFound, reading the session again and trying once more is the
remedy for Conflict, and Refused means the engine looked at the request
and said no — retrying it unchanged will not change the answer.
Variants§
CeremonyNotFound
Conflict
Somebody else wrote to what this call was writing to.
Distinct from Refused because the remedies are opposites: a
refusal will answer the same way however often it is asked, while a
lost race is worth reading again and repeating. Folding the two
together makes a consumer either give up on races it would have won
or hammer a call that will never succeed.
Refused
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ApiError
impl<'de> Deserialize<'de> for ApiError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ApiError
Source§impl Error for ApiError
impl Error for ApiError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()