wp_mini_epub/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum AppError {
5    #[error("Authentication failed: invalid username or password")]
6    AuthenticationFailed,
7
8    #[error("User is not logged in")]
9    NotLoggedIn,
10
11    #[error("Failed to log out")]
12    LogoutFailed,
13
14    #[error("Story with ID {0} could not be found")]
15    StoryNotFound(i32),
16
17    #[error("Failed to fetch story metadata from Wattpad")]
18    MetadataFetchFailed,
19
20    #[error("Failed to download story content")]
21    DownloadFailed,
22
23    #[error("Failed to process chapter content")]
24    ChapterProcessingFailed,
25
26    #[error("Failed to generate the EPUB file")]
27    EpubGenerationFailed,
28
29    #[error("An I/O error occurred")]
30    IoError(#[from] std::io::Error),
31}