1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Error, Debug)]
10pub enum Error {
11 #[error("Invalid URI: {0}")]
13 InvalidUri(String),
14
15 #[error("Purple ID error: {0}")]
17 PurpleError(String),
18
19 #[error("Database error: {0}")]
21 DatabaseError(#[from] rusqlite::Error),
22
23 #[error("I/O error: {0}")]
25 Io(#[from] std::io::Error),
26
27 #[error("Link already exists between {uri_a} and {uri_b}")]
29 LinkAlreadyExists {
30 uri_a: String,
32 uri_b: String,
34 },
35
36 #[error("Bookmark '{id}' already exists in the store")]
38 BookmarkAlreadyExists {
39 id: String,
41 },
42
43 #[error("Database schema version {found} is newer than supported version {supported}. Please upgrade hitchmark.")]
45 SchemaTooNew {
46 found: u32,
48 supported: u32,
50 },
51
52 #[error("{0}")]
54 Other(String),
55}