pub enum DavError {
Unauthorized,
Forbidden,
NotFound,
BadRequest(String),
Conflict,
PreconditionFailed,
MethodNotAllowed,
ServiceUnavailable,
ServerError(String),
}Expand description
Errors a DAV handler can return.
Most variants map 1:1 to HTTP status codes; ServerError
is the catch-all for anything the store impl can’t classify.
Variants§
401 — auth required. Server-side wrapper is expected to add the
WWW-Authenticate header.
Forbidden
403 — authenticated but not permitted.
NotFound
404 — resource doesn’t exist.
BadRequest(String)
400 — malformed request body / unsupported parameters.
Conflict
409 — server-side semantic conflict (e.g. parent collection missing).
PreconditionFailed
412 — If-Match / If-None-Match precondition failed.
MethodNotAllowed
405 — verb not allowed on this resource.
503 — backing store unavailable (e.g. database down).
ServerError(String)
500 — anything else. Description is for the server log, not the client.
Implementations§
Source§impl DavError
impl DavError
Sourcepub fn to_dav_response(&self) -> DavResponse
pub fn to_dav_response(&self) -> DavResponse
Convert into the minimal DavResponse a server can serve directly.
Bodies are short, plain-text, ASCII; suitable as a fallback when the server-side adapter doesn’t want to do custom error formatting.
Trait Implementations§
Source§impl Error for DavError
impl Error for DavError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()