Skip to content

Commit 08bc111

Browse files
committed
feat: add library structure with error types
1 parent 0c7d8aa commit 08bc111

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/error.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use thiserror::Error;
2+
3+
#[derive(Error, Debug)]
4+
pub enum Error {
5+
#[error("IO error: {0}")]
6+
Io(#[from] std::io::Error),
7+
8+
#[error("Invalid update information: {0}")]
9+
InvalidUpdateInfo(String),
10+
11+
#[error("HTTP error: {0}")]
12+
Http(String),
13+
14+
#[error("GitHub API error: {0}")]
15+
GitHubApi(String),
16+
17+
#[error("AppImage error: {0}")]
18+
AppImage(String),
19+
}
20+
21+
pub type Result<T> = std::result::Result<T, Error>;

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pub mod appimage;
2+
pub mod error;
3+
pub mod update_info;
4+
pub mod updater;
5+
6+
pub use error::Error;
7+
pub use updater::Updater;

0 commit comments

Comments
 (0)