actpub_webfinger/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error)]
7#[non_exhaustive]
8pub enum Error {
9 #[error("invalid acct URI: {0}")]
11 InvalidAcct(String),
12
13 #[error("invalid URL: {0}")]
15 InvalidUrl(#[from] url::ParseError),
16
17 #[error("WebFinger JRD is missing `subject`")]
19 MissingSubject,
20
21 #[error("WebFinger subject mismatch: requested {requested}, got {returned}")]
23 SubjectMismatch {
24 requested: String,
26 returned: String,
28 },
29
30 #[error("WebFinger JRD does not reference an ActivityPub actor")]
32 MissingActorLink,
33
34 #[cfg(feature = "client")]
36 #[cfg_attr(docsrs, doc(cfg(feature = "client")))]
37 #[error("HTTP error: {0}")]
38 Http(#[from] reqwest::Error),
39
40 #[cfg(feature = "client")]
42 #[cfg_attr(docsrs, doc(cfg(feature = "client")))]
43 #[error("WebFinger server returned status {0}")]
44 BadStatus(u16),
45
46 #[cfg(feature = "client")]
53 #[cfg_attr(docsrs, doc(cfg(feature = "client")))]
54 #[error("WebFinger response exceeded {0} bytes")]
55 ResponseTooLarge(u64),
56
57 #[error("JSON error: {0}")]
59 Json(#[from] serde_json::Error),
60}