pub struct ErrorDraft { /* private fields */ }Expand description
An error that still owes the reader its recovery sentence.
Both constructors return this rather than an AxError, and
ErrorDraft::with_recovery is the only way across, so a failure that
never says what to do next cannot be spelled. Shaping happens here;
an AxError is finished the moment it exists.
Implementations§
Source§impl ErrorDraft
impl ErrorDraft
Sourcepub fn with_nearby(self, nearby: Vec<String>) -> Self
pub fn with_nearby(self, nearby: Vec<String>) -> Self
Names the spellings the caller could have used instead. Directly usable values only, not a description of them.
Sourcepub fn effect_unknown(self) -> Self
pub fn effect_unknown(self) -> Self
Declares that the request went out and its answer was lost, so
whether its effect landed is not known. Drops any wait set
before it, because a wait belongs to Retry::Yes alone.
Sourcepub fn retriable_after(self, wait_ms: u64) -> Self
pub fn retriable_after(self, wait_ms: u64) -> Self
Declares the action safe to retry, and no sooner than wait_ms
from now: the other side’s own word on when it recovers.
Sourcepub fn with_recovery(self, recovery: impl Into<String>) -> AxError
pub fn with_recovery(self, recovery: impl Into<String>) -> AxError
Writes the one sentence that tells the reader what to do next, and hands back the finished error. The reader is as often a model as a person, so the sentence names a key, a file and line, or a command.