simplify / unify error handling
We want to return a Result<Blog>, instead of a QueryResult<Blog>. We can use map_err() to map it to the desired error type. thanks to review from @BaptisteGelez & @fdb-hiroshima.
This commit is contained in:
@@ -14,12 +14,6 @@ impl From<Error> for ErrorPage {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<diesel::result::Error> for ErrorPage {
|
||||
fn from(err: diesel::result::Error) -> ErrorPage {
|
||||
ErrorPage(plume_models::Error::Db(err))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'r> Responder<'r> for ErrorPage {
|
||||
fn respond_to(self, req: &Request) -> response::Result<'r> {
|
||||
let rockets = req.guard::<PlumeRocket>().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user