#[non_exhaustive]pub enum Error {
Show 17 variants
Xml(Error),
UnexpectedRoot {
expected: &'static str,
found: String,
},
MissingElement {
parent: &'static str,
element: &'static str,
},
InvalidValue {
element: &'static str,
value: String,
},
UnknownService(String),
AmbiguousService {
reference: String,
candidates: Vec<String>,
},
InvalidName {
element: &'static str,
name: String,
},
Http(Error),
Status {
status: u16,
url: String,
},
CredentialsRequired,
AuthenticationFailed,
UnsupportedAuth(String),
Upnp {
code: u16,
description: String,
},
InvalidResponse(String),
InvalidUrl(String),
InvalidFingerprint(String),
CertificateMismatch {
expected: Fingerprint,
found: Fingerprint,
},
}Expand description
Errors of this crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Xml(Error)
A document is not well-formed XML.
UnexpectedRoot
A document has a different root element than expected, for example an SCPD where a device description was expected.
Fields
MissingElement
A required element is missing or empty.
Fields
InvalidValue
An element has a value outside the allowed set.
UnknownService(String)
No service of the device matches the given reference.
AmbiguousService
More than one service of the device matches the given reference.
Fields
InvalidName
An action or argument name is not a valid XML element name.
Http(Error)
The request failed before a response arrived, for example because the device was unreachable or did not answer in time.
Status
The device answered with an unexpected HTTP status.
CredentialsRequired
The device requires authentication, but the client has no credentials.
AuthenticationFailed
The device rejected the credentials. The client does not retry, so that a wrong password does not lock the account.
UnsupportedAuth(String)
The device asked for an authentication scheme this crate does not support.
Upnp
The device answered an action call with a UPnP error.
Fields
InvalidResponse(String)
A response is well-formed XML but not what the call expected.
InvalidUrl(String)
A URL cannot be used, for example because it points to another host than the device.
InvalidFingerprint(String)
A certificate fingerprint is not 64 hex digits.
CertificateMismatch
The device presented another certificate than the pinned one. Either the device got a new certificate, or someone else is answering.
Fields
expected: FingerprintThe pinned fingerprint.
found: FingerprintThe fingerprint of the presented certificate.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()