pub enum Error {
Http(Error),
Refused(Refusal),
Url(String),
Keys,
Note(NoteError),
NoLayers(NoLayers),
Request(RequestError),
Pay(PayError),
FaucetAmount(u64),
Check(CheckError),
Load(LoadError),
Store(Error),
}Variants§
Http(Error)
The request did not complete: no connection, a timeout, or an answer that was not what the route returns. A transfer may still have been applied; resending it is safe.
Refused(Refusal)
The mint answered with an error.
Url(String)
The server URL is not an http or https URL.
Keys
The keys a mint served belong to another issuer.
Note(NoteError)
A note handed over does not carry the mint’s signature.
NoLayers(NoLayers)
The mint’s info lists no layers.
Request(RequestError)
A payment request could not be made.
Pay(PayError)
A payment could not be made.
FaucetAmount(u64)
A playground faucet hands out notes of an amount its mint cannot make as one note.
Check(CheckError)
A payment does not pay what was asked.
Load(LoadError)
The store could not be read.
Store(Error)
The store could not be read or written. Nothing was handed out that depends on the change that failed to save.
Implementations§
Source§impl Error
impl Error
Sourcepub fn code(&self) -> Option<&str>
pub fn code(&self) -> Option<&str>
The mint’s error code, when the mint answered with one; see
Refusal::code.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Whether trying again later may succeed: the request did not complete, or the mint was paused, busy or failed to store the change. Transfers and burns are safe to resend.
layer_full does not count, though the mint answers it with 503: a
transfer refused so is refused every time, since its notes would land
in the same full generation after every rotation until the note it
spends expires. A mint request refused so may pass after the next
rotation, which brings a newer generation to the mint layer.
Sourcepub fn retry_after(&self) -> Option<Duration>
pub fn retry_after(&self) -> Option<Duration>
How long the mint asked to wait before trying again, when it
answered with a Retry-After, as it does with busy; see
Refusal::retry_after.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()