mirror of
https://github.com/lennart-k/rustical.git
synced 2026-01-30 11:48:18 +00:00
rename dav::XmlError
This commit is contained in:
@@ -20,7 +20,7 @@ pub enum Error {
|
|||||||
PropReadOnly,
|
PropReadOnly,
|
||||||
|
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
XmlDeserializationError(#[from] rustical_xml::XmlError),
|
XmlError(#[from] rustical_xml::XmlError),
|
||||||
|
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
IOError(#[from] std::io::Error),
|
IOError(#[from] std::io::Error),
|
||||||
@@ -33,7 +33,7 @@ impl actix_web::error::ResponseError for Error {
|
|||||||
Self::NotFound => StatusCode::NOT_FOUND,
|
Self::NotFound => StatusCode::NOT_FOUND,
|
||||||
Self::BadRequest(_) => StatusCode::BAD_REQUEST,
|
Self::BadRequest(_) => StatusCode::BAD_REQUEST,
|
||||||
Self::Unauthorized => StatusCode::UNAUTHORIZED,
|
Self::Unauthorized => StatusCode::UNAUTHORIZED,
|
||||||
Self::XmlDeserializationError(_) => StatusCode::BAD_REQUEST,
|
Self::XmlError(_) => StatusCode::BAD_REQUEST,
|
||||||
Error::PropReadOnly => StatusCode::CONFLICT,
|
Error::PropReadOnly => StatusCode::CONFLICT,
|
||||||
Self::IOError(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
Self::IOError(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ pub(crate) async fn route_propfind<R: ResourceService>(
|
|||||||
|
|
||||||
// A request body is optional. If empty we MUST return all props
|
// A request body is optional. If empty we MUST return all props
|
||||||
let propfind: PropfindElement = if !body.is_empty() {
|
let propfind: PropfindElement = if !body.is_empty() {
|
||||||
PropfindElement::parse_str(&body).map_err(Error::XmlDeserializationError)?
|
PropfindElement::parse_str(&body).map_err(Error::XmlError)?
|
||||||
} else {
|
} else {
|
||||||
PropfindElement {
|
PropfindElement {
|
||||||
prop: PropfindType::Allprop,
|
prop: PropfindType::Allprop,
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ pub(crate) async fn route_proppatch<R: ResourceService>(
|
|||||||
// Extract operations
|
// Extract operations
|
||||||
let PropertyupdateElement::<SetPropertyPropWrapperWrapper<<R::Resource as Resource>::Prop>>(
|
let PropertyupdateElement::<SetPropertyPropWrapperWrapper<<R::Resource as Resource>::Prop>>(
|
||||||
operations,
|
operations,
|
||||||
) = XmlDocument::parse_str(&body).map_err(Error::XmlDeserializationError)?;
|
) = XmlDocument::parse_str(&body).map_err(Error::XmlError)?;
|
||||||
|
|
||||||
let mut resource = resource_service.get_resource(&path).await?;
|
let mut resource = resource_service.get_resource(&path).await?;
|
||||||
let privileges = resource.get_user_privileges(&user)?;
|
let privileges = resource.get_user_privileges(&user)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user