pub enum TrqlError {
Config(String),
Transport {
kind: TransportKind,
detail: String,
},
Timeout {
kind: TransportKind,
waited_secs: u64,
},
Rejected {
code: TrustTaskCode,
retryable: bool,
retry_after: Option<DateTime<Utc>>,
message: Option<String>,
},
Contract(String),
NoMatchingTransport {
ours: Vec<TransportKind>,
theirs: Vec<TransportKind>,
},
}Expand description
Errors returned by crate::TrqlClient and crate::TrqlTransport
implementations.
Variants§
Config(String)
The client or transport was built with missing/invalid configuration.
Transport
The transport could not complete the exchange (connect, send, or receive failure). Retryable at the caller’s discretion.
Fields
kind: TransportKindWhich binding failed.
Timeout
No reply arrived within the transport’s configured reply window.
Rejected
The registry answered with a trust-task-error document.
Fields
code: TrustTaskCodeMachine-readable trust-task error code.
Contract(String)
The peer’s reply violated the Trust Task contract: it didn’t parse, wasn’t correlated to the request, or carried an unexpected type. This is a bug on one side of the wire, not a transient condition — it is never worth retrying.
NoMatchingTransport
The registry advertises no transport this client also speaks.
Carries both sides’ sets so an operator can see what to enable rather than guess. Never a silent downgrade to a transport the registry did not advertise.
Fields
ours: Vec<TransportKind>Transports this client can use (compiled in and offered).
theirs: Vec<TransportKind>Transports the registry advertises in its DID document.
Implementations§
Trait Implementations§
Source§impl Error for TrqlError
impl Error for TrqlError
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()