#[non_exhaustive]pub enum Error {
InvalidUrl(ParseError),
VersionNotAdvertised {
requested: &'static str,
},
Http(Error),
BadStatus(u16),
ResponseTooLarge(u64),
Json(Error),
CrossOriginHref {
discovery: Url,
href: Url,
},
}Expand description
All failure modes for this crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidUrl(ParseError)
A URL could not be parsed.
VersionNotAdvertised
The requested schema version was not advertised by the server.
Http(Error)
client only.An HTTP transport error.
BadStatus(u16)
client only.The server responded with a non-success status.
ResponseTooLarge(u64)
client only.The response body exceeded the configured maximum size. Raised
only by the client helpers, which cap incoming bodies to a
generous default (see
DEFAULT_MAX_BODY_BYTES).
Json(Error)
The response body could not be parsed as JSON.
CrossOriginHref
client only.The discovery document advertised a NodeInfo document URL
whose origin (scheme + host + port) does not match the
host the discovery fetch was directed at.
This defends against an SSRF pivot where an attacker serves
/.well-known/nodeinfo pointing at a cloud-metadata or
loopback URL; fetch_with_limit
refuses to follow the cross-origin hop before it reaches
the transport.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()