pub enum Error {
Io(Error),
Config {
file: String,
line: usize,
message: String,
},
Json {
line: usize,
column: usize,
message: String,
},
Template {
file: String,
line: usize,
column: usize,
message: String,
},
Protocol(String),
Unavailable(String),
Message(String),
}Expand description
Every failure the framework itself can produce.
Application errors are expected to convert into this through From, which
is what lets a handler return Result<T, E> and still be a valid handler.
Variants§
Io(Error)
A file could not be read or written.
Config
A .env or config file was malformed.
Json
A JSON document could not be parsed.
Template
A template could not be parsed or rendered.
Carries the position because a view is written by hand, often by someone who is not the person reading the stack trace.
Protocol(String)
A malformed HTTP request reached the parser.
A dependency was not tried, because it is known to be failing.
Distinct from a failure on purpose: nothing was sent, so nothing can
have had an effect, and a caller may safely fall back to a cache, a
default, or a degraded answer. Raised by the circuit breaker in
rustlavel-client.
Message(String)
Anything raised by application code.
Implementations§
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()