mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 04:42:15 +00:00
Add explicit error type to propfind resources
This commit is contained in:
@@ -5,6 +5,9 @@ pub enum Error {
|
||||
#[error("Unauthorized")]
|
||||
Unauthorized,
|
||||
|
||||
#[error("Not Found")]
|
||||
NotFound,
|
||||
|
||||
#[error("Not implemented")]
|
||||
NotImplemented,
|
||||
|
||||
@@ -33,6 +36,7 @@ impl actix_web::ResponseError for Error {
|
||||
Error::XmlDecodeError(_) => StatusCode::BAD_REQUEST,
|
||||
Error::NotImplemented => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
Error::Other(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
Error::NotFound => StatusCode::NOT_FOUND,
|
||||
}
|
||||
}
|
||||
fn error_response(&self) -> actix_web::HttpResponse<actix_web::body::BoxBody> {
|
||||
|
||||
Reference in New Issue
Block a user