mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 05:56:31 +03:00
Simplify SQL error handling (#2415)
* Remove sql::error submodule Use anyhow errors instead. * Remove explicit checks for open SQL connection An error will be thrown anyway during attempt to execute query. * Don't use `with_conn()` and remove it * Remove unused `with_conn_async` * Resultify markseen_msgs
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum Error {
|
||||
#[error("Sqlite error: {0:?}")]
|
||||
Sql(#[from] rusqlite::Error),
|
||||
#[error("Sqlite Connection Pool Error: {0:?}")]
|
||||
ConnectionPool(#[from] r2d2::Error),
|
||||
#[error("Sqlite: Connection closed")]
|
||||
SqlNoConnection,
|
||||
#[error("Sqlite: Already open")]
|
||||
SqlAlreadyOpen,
|
||||
#[error("Sqlite: Failed to open")]
|
||||
SqlFailedToOpen,
|
||||
#[error("{0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
// #[error("{0:?}")]
|
||||
// BlobError(#[from] crate::blob::BlobError),
|
||||
#[error("{0}")]
|
||||
Other(#[from] anyhow::Error),
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
@@ -1,10 +1,12 @@
|
||||
use super::{Result, Sql};
|
||||
use anyhow::Result;
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::constants::ShowEmails;
|
||||
use crate::context::Context;
|
||||
use crate::dc_tools::EmailAddress;
|
||||
use crate::imap;
|
||||
use crate::provider::get_provider_by_domain;
|
||||
use crate::sql::Sql;
|
||||
|
||||
const DBVERSION: i32 = 68;
|
||||
const VERSION_CFG: &str = "dbversion";
|
||||
|
||||
Reference in New Issue
Block a user