change posterror back to apperror
This commit is contained in:
parent
07e6b4e844
commit
9046ac910d
1 changed files with 8 additions and 1 deletions
|
@ -63,7 +63,7 @@ struct ViewPostTemplate {
|
||||||
markdown_access: bool,
|
markdown_access: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppResult<T> = Result<T, PostError>;
|
type AppResult<T> = Result<T, AppError>;
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
enum AppError {
|
enum AppError {
|
||||||
|
@ -71,6 +71,13 @@ enum AppError {
|
||||||
PostError(#[from] PostError),
|
PostError(#[from] PostError),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<std::io::Error> for AppError {
|
||||||
|
#[inline(always)]
|
||||||
|
fn from(value: std::io::Error) -> Self {
|
||||||
|
Self::PostError(PostError::IoError(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "error.html")]
|
#[template(path = "error.html")]
|
||||||
struct ErrorTemplate {
|
struct ErrorTemplate {
|
||||||
|
|
Loading…
Reference in a new issue