Add explicit error type to propfind resources

This commit is contained in:
Lennart
2024-06-01 13:58:43 +02:00
parent 1d763b5c8f
commit bee4675f82
8 changed files with 97 additions and 41 deletions

View File

@@ -13,6 +13,8 @@ pub enum Error {
Unauthorized,
#[error("Internal server error :(")]
InternalError,
#[error(transparent)]
XmlDecodeError(#[from] quick_xml::DeError),
#[error("Internal server error")]
Other(#[from] anyhow::Error),
}
@@ -25,6 +27,7 @@ impl actix_web::error::ResponseError for Error {
Self::NotFound => StatusCode::NOT_FOUND,
Self::BadRequest => StatusCode::BAD_REQUEST,
Self::Unauthorized => StatusCode::UNAUTHORIZED,
Self::XmlDecodeError(_) => StatusCode::BAD_REQUEST,
}
}