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),
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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more