quokka_templating/
error.rs1use axum::{http::StatusCode, response::IntoResponse};
2
3#[derive(Clone, Debug, thiserror::Error)]
4pub enum Error {
5 #[error("Unable to render Sass for path {0}")]
6 SassRenderError(String),
7 #[error("Unable to render styles for group {0}")]
8 SassRenderGroupError(String),
9 #[error("Unable to resolve file {0}")]
10 PathNotFoundError(String),
11 #[error("Unable to join style {0}")]
12 JoinStyleError(String),
13 #[error("Unablo to register template source {0}")]
14 RegisterTemplateSourceError(String),
15 #[error("Unable to render template {0}")]
16 RenderTemplateError(String),
17}
18
19pub type Result<T> = std::result::Result<T, Error>;
20
21impl IntoResponse for Error {
22 fn into_response(self) -> axum::response::Response {
23 (StatusCode::INTERNAL_SERVER_ERROR).into_response()
24 }
25}