1mod client;
3pub mod types;
5
6pub use self::client::Client;
7pub use self::types::Deviation;
8pub use self::types::DeviationExtended;
9pub use self::types::ListFolderContentsResponse;
10pub use self::types::OEmbed;
11pub use self::types::ScrapedStashInfo;
12pub use self::types::ScrapedWebPageInfo;
13pub use url::Url;
14
15#[derive(Debug, thiserror::Error)]
17pub enum Error {
18 #[error(transparent)]
20 Reqwest(#[from] reqwest::Error),
21
22 #[error(transparent)]
24 Url(#[from] url::ParseError),
25
26 #[error(transparent)]
28 TokioJoin(#[from] tokio::task::JoinError),
29
30 #[error(transparent)]
32 Json(#[from] serde_json::Error),
33
34 #[error("invalid scraped webpage")]
36 InvalidScrapedWebPage(#[from] self::types::scraped_webpage_info::FromHtmlStrError),
37
38 #[error("invalid scraped stash info")]
40 InvalidScrapedStashInfo(#[from] self::types::scraped_stash_info::FromHtmlStrError),
41
42 #[error("sign in failed")]
44 SignInFailed,
45
46 #[error("missing field \"{name}\"")]
48 MissingField {
49 name: &'static str,
51 },
52
53 #[error("missing streams")]
55 MissingStreams,
56
57 #[error("missing browse page stream")]
59 MissingBrowsePageStream,
60
61 #[error("missing deviation {0}")]
63 MissingDeviation(u64),
64
65 #[error("cookie store error")]
67 CookieStore(WrapBoxError),
68}
69
70#[derive(Debug)]
72pub struct WrapBoxError(pub Box<dyn std::error::Error + Send + Sync + 'static>);
73
74impl std::fmt::Display for WrapBoxError {
75 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
76 self.0.fmt(f)
77 }
78}
79
80impl std::error::Error for WrapBoxError {}
81
82