pub enum BridgeError {
Unreadable(EnvelopeError),
FeatureUnavailable {
feature: Feature,
},
Unreachable {
reason: String,
},
Close(String),
NotReadable(LowerError),
MethodNotBridged {
method: String,
downstream: ProtocolSide,
},
}Expand description
Why a bridge could not carry an envelope.
Variants§
Unreadable(EnvelopeError)
The envelope is not a JSON-RPC message, or a member has the wrong type.
The peers never settled on the same feature.
Unreachable
The upstream peer could not be reached, or hung up.
Deliberately not carrying the peer’s own error envelope: a protocol
refusal travels as a normal Err-free envelope, so reaching this arm
means the message genuinely did not get through.
Close(String)
Shutting the connection down failed.
NotReadable(LowerError)
The reply could not be expressed at the downstream client’s revision.
Not a transport failure and not the upstream’s refusal — the upstream answered, and the answer is in a dialect the client did not negotiate. Under a strict policy the bridge refuses rather than hand over something the client cannot read; the cause names the feature and the revision so the operator can tell a missing capability from a bug.
MethodNotBridged
The method is one this bridge’s cross-protocol codec has no rule for.
Distinct from FeatureUnavailable:
FeatureUnavailable means the two peers share no feature for the
method at all; MethodNotBridged means the bridge could in principle
carry it (the codec for the relevant protocol pair exists) but the
specific method is not modelled yet. The loop renders both as
-32601 Method not found, but the operator needs to tell them
apart: a FeatureUnavailable is a configuration gap, a
MethodNotBridged is a follow-up commit.
Gated behind the a2a feature because the only bridge that
surfaces it is a cross-protocol one, and the type it carries
(ProtocolSide) is itself feature-gated. A default-features
build has no cross-protocol bridge and therefore no way to
produce this variant, so it is omitted from the enum rather
than carrying a degenerate form.
Fields
downstream: ProtocolSideThe protocol side the call came in on.
Trait Implementations§
Source§impl Debug for BridgeError
impl Debug for BridgeError
Source§impl Display for BridgeError
impl Display for BridgeError
Source§impl Error for BridgeError
impl Error for BridgeError
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()