1use thiserror::Error;
2use tokio::sync::AcquireError;
3
4pub use crate::database::DatabaseError;
5pub use crate::feed_api::FeedApiError;
6pub use crate::opml::OpmlError;
7pub use crate::util::favicons::FavIconError;
8pub use crate::util::feed_parser::FeedParserError;
9
10#[derive(Error, Debug)]
11pub enum NewsFlashError {
12 #[error("Database Error")]
13 Database(#[from] DatabaseError),
14 #[error("Feed API Error")]
15 API(#[from] FeedApiError),
16 #[error("IO Error")]
17 IO(#[from] std::io::Error),
18 #[error("Failed to load Feed API")]
19 LoadBackend,
20 #[error("Error laoding favicon")]
21 Icon(#[from] FavIconError),
22 #[error("Error parsing url")]
23 Url(#[from] url::ParseError),
24 #[error("This operation requires the api to be logged in")]
25 NotLoggedIn,
26 #[error("Error laoding/generating thumbnail")]
27 Thumbnail,
28 #[error("Parsing OPML file failed")]
29 OPML(#[from] OpmlError),
30 #[cfg(feature = "image-downloader")]
31 #[error("Failed to download images for article")]
32 ImageDownload(#[from] article_scraper::ImageDownloadError),
33 #[error("Failed to download full content for article")]
34 GrabContent,
35 #[error("Couldn't acquire download permit from semaphore")]
36 Semaphore(#[from] AcquireError),
37 #[error("Operation not possible during sync")]
38 Syncing,
39 #[error("Operation not possible while offline")]
40 Offline,
41 #[error("An unknown Error occoured")]
42 Unknown,
43}