use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error("Invalid URI: {0}")]
InvalidUri(String),
#[error("Purple ID error: {0}")]
PurpleError(String),
#[error("Database error: {0}")]
DatabaseError(#[from] rusqlite::Error),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Link already exists between {uri_a} and {uri_b}")]
LinkAlreadyExists {
uri_a: String,
uri_b: String,
},
#[error("Bookmark '{id}' already exists in the store")]
BookmarkAlreadyExists {
id: String,
},
#[error("Database schema version {found} is newer than supported version {supported}. Please upgrade hitchmark.")]
SchemaTooNew {
found: u32,
supported: u32,
},
#[error("{0}")]
Other(String),
}