pub enum DownstreamError {
Malformed,
NoHandshake(ProtocolVersion),
UnnegotiableVersion,
Assemble(JsonObjectError),
}Expand description
Why a downstream handshake could not be settled.
Distinct from an upstream that cannot be reached: the upstream failed before
negotiate was ever called, and this type is only ever about what the
client in front of us said.
Variants§
Malformed
The initialize request was not readable as an offer.
Collapsed to one variant for the same reason
InitializeError
is: the caller answers -32600 either way, and a proxy reporting which
of six shapes failed would be telling the client about the proxy’s
internals.
NoHandshake(ProtocolVersion)
The negotiation settled on a revision with no handshake.
SEP-2575 removed initialize from 2026-07-28, and
negotiate_server echoes a revision it supports — so a client asking
for exactly that one reaches here. It cannot on the path below, because
such a client is walked back to the newest revision that has a
handshake. It stays in the signature for the one case that walk-back
cannot cover: a bridge restricted to revisions with no handshake at all,
where there is nothing to walk back to.
UnnegotiableVersion
This build has no revisions to negotiate over at all.
Assemble(JsonObjectError)
The reply could not be assembled into an object.
Cannot happen for the body built below, which is a literal object of
string members — but from_value is fallible and the honest signature
is the one that says so. Inventing a second error for it would be a
promise this function cannot keep.
Trait Implementations§
Source§impl Debug for DownstreamError
impl Debug for DownstreamError
Source§impl Display for DownstreamError
impl Display for DownstreamError
Source§impl Error for DownstreamError
impl Error for DownstreamError
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()