change posterror back to apperror

This commit is contained in:
slonkazoid 2024-04-20 23:46:20 +03:00
parent 07e6b4e844
commit 9046ac910d
Signed by: slonk
SSH key fingerprint: SHA256:tbZfJX4IOvZ0LGWOWu5Ijo8jfMPi78TU7x1VoEeCIjM

View file

@ -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 {