WebDAV permissions and logging (closes #1362)

This commit is contained in:
mdecimus
2025-05-09 15:47:09 +02:00
parent fe7d646966
commit 095c501a66
50 changed files with 1031 additions and 273 deletions

View File

@@ -4,7 +4,10 @@
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
*/
use std::borrow::Cow;
use std::{
borrow::Cow,
fmt::{Display, Formatter},
};
use quick_xml::events::BytesStart;
use tokenizer::Tokenizer;
@@ -152,3 +155,18 @@ impl Default for RawElement<'_> {
RawElement(BytesStart::new(""))
}
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Error::Xml(err) => write!(f, "XML error: {}", err),
Error::UnexpectedToken { expected, found } => {
write!(f, "Unexpected token: {found:?}")?;
if let Some(expected) = expected {
write!(f, ", expected: {expected:?}")?;
}
Ok(())
}
}
}
}