mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 11:42:25 +00:00
split store and store_sqlite implementatio into multiple crates
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
|
||||
pub enum Error {
|
||||
#[error("Not found")]
|
||||
NotFound,
|
||||
@@ -9,21 +10,9 @@ pub enum Error {
|
||||
#[error("Invalid ics/vcf input: {0}")]
|
||||
InvalidData(String),
|
||||
|
||||
#[error(transparent)]
|
||||
SqlxError(sqlx::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
Other(#[from] anyhow::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
ParserError(#[from] ical::parser::ParserError),
|
||||
}
|
||||
|
||||
impl From<sqlx::Error> for Error {
|
||||
fn from(value: sqlx::Error) -> Self {
|
||||
match value {
|
||||
sqlx::Error::RowNotFound => Error::NotFound,
|
||||
err => Error::SqlxError(err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user