pub enum VtcError {
NotAuthenticated,
Http {
status: u16,
body: String,
},
Url(String),
Transport(Error),
Auth(VtaError),
Unsupported(&'static str),
Signing(String),
Session(String),
NoRestTransport(&'static str),
}Expand description
Errors surfaced by the VTC client.
Variants§
NotAuthenticated
A request needed a bearer token but the client has none — call
VtcClient::connect (or construct via VtcClient::with_token).
Http
The VTC returned a non-success HTTP status.
Url(String)
A request URL could not be built.
Transport(Error)
A transport-level error talking to the VTC.
Auth(VtaError)
Challenge-response authentication failed.
Unsupported(&'static str)
The operation’s route no longer exists on the VTC and this client has no replacement for it. Carries what to use instead.
Signing(String)
Building or signing a holder Trust Task failed — e.g. an applicant DID
that is not a did:key passed to the did:key convenience wrapper, a
verification method with no fragment, or an undecodable private key.
Session(String)
Opening or using a messaging session to the VTC failed.
Distinct from Transport, which is HTTPS: a mediator
that will not route and a URL that will not resolve are different
faults with different fixes, and one error that covered both would send
the reader to the wrong half of the system.
NoRestTransport(&'static str)
A verb that only exists on the HTTPS surface was called on a client built with no REST base.
The admin verbs are gated on a bearer token and a per-route
Trust-Task header, which is a URL-shaped surface — they cannot ride a
session. Rather than fail at the transport with something obscure, say
so: pass rest_url to the connect_* constructor.
Trait Implementations§
Source§impl Error for VtcError
impl Error for VtcError
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()