spectrust_fastly_worker/error.rs
1use std::net::AddrParseError;
2
3use thiserror::Error;
4
5/// Top-level error enumeration
6#[derive(Error, Debug)]
7pub enum Error {
8 /// We couldn't find a Fastly Backend mapping for an incoming request's hostname.
9 #[error("Missing Fastly backend for host {0}")]
10 MissingFastlyBackend(String),
11 /// Host is missing from the Url, this will likely never occur with this library.
12 /// We don't want to panic in any case though, so this is our representation of a
13 /// possible error while reading the host.
14 #[error("Host missing from Url")]
15 MissingHost,
16 /// There was an error parsing the IP address from headers.
17 #[error(transparent)]
18 AddrParse(#[from] AddrParseError),
19}