#[non_exhaustive]pub enum Error {
Show 13 variants
ReadConfig {
path: PathBuf,
source: Error,
},
Toml {
path: Option<PathBuf>,
source: Error,
},
InvalidConfig {
key: &'static str,
reason: String,
},
InvalidPrefix {
prefix: String,
},
NonCanonicalPrefix {
prefix: String,
normal: String,
},
DuplicatePrefix {
prefix: String,
},
InvalidUpstream {
route: String,
upstream: String,
reason: String,
source: Option<InvalidUri>,
},
InvalidCooldown {
route: String,
reason: String,
},
ConflictingCooldown {
route: String,
upstream: String,
cooldown_secs: u64,
other_secs: u64,
},
InvalidHealthPath {
route: String,
path: String,
},
ConflictingHealth {
route: String,
upstream: String,
setting: &'static str,
value: String,
other: String,
},
InvalidCidr {
entry: String,
reason: String,
},
InvalidBreakerConfig {
reason: String,
upstream: Option<String>,
},
}Expand description
Why a config, upstream, breaker or CIDR list was rejected.
Match on the variant to react by category; Display gives the
human-readable message (it names the route prefix and upstream where one
is involved). Variants may be added in minor releases.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ReadConfig
The config file could not be read.
Toml
The config file is not valid TOML for the schema.
path is None when parsed from a string or table
(ConfigToml::from_str, from_table).
InvalidConfig
A top-level key is out of range. reason is e.g. must be >= 1.
InvalidPrefix
A route prefix does not start with /.
NonCanonicalPrefix
A route prefix is not in normalised form (unreserved characters
unescaped, uppercase hex, no //, ASCII only), so it could never match,
or contains ;, \, %2F or %5C (every request would be rejected).
DuplicatePrefix
Two routes share a prefix.
InvalidUpstream
A route’s upstream URI is unusable (bad URI, scheme, host, path…).
InvalidCooldown
A route’s cooldown_secs is out of range.
ConflictingCooldown
Routes sharing one upstream (one breaker) disagree on the cooldown.
InvalidHealthPath
A route’s health_path is not an absolute path without query or fragment.
ConflictingHealth
Routes sharing one upstream (one breaker) disagree on a health setting.
Fields
InvalidCidr
A trusted_proxies entry is not a valid CIDR or address.
InvalidBreakerConfig
BreakerConfig failed validation (Breaker::new, Upstream::new).
upstream is the host:port name when raised by Upstream::new.
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()