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),
AnswerMismatch {
field: &'static str,
asked: String,
answered: String,
},
ReferralNotClosed {
origin: String,
answered: 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.
AnswerMismatch
The reply is correlated to our request but answers a different TRQP tuple than the one we asked about.
Correlation proves the reply belongs to our exchange; it says nothing
about what the reply is an answer to. A registry that echoes a
different entity_id/authority_id/action/resource has answered
someone else’s question, and treating it as ours silently substitutes
the subject of an authorization decision.
Fields
ReferralNotClosed
We followed a referral to this registry, and its answer does not claim the authority that referred us.
A TrustRegistry referral in a VTC’s DID document is a
self-assertion — anyone may publish a document naming any registry.
Authority flows registry → subject, so a referral is only closed when
the registry answers for the DID we started from. Until then the
referral has established where to ask and nothing about the answer.
Fields
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()