From b17d9fc988f0ea0fcc687d41fb897bbebaef264e Mon Sep 17 00:00:00 2001 From: davidemazzocchi Date: Fri, 27 Feb 2026 09:53:07 +0100 Subject: [PATCH] feat: encapsulate rusqlite::Error into sqlite::FailedTo (ExecuteBatch) --- 01.workspace/heave/src/fun/sqlite_init_db.rs | 2 +- 01.workspace/heave/src/str/sqlite_failed_to.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/01.workspace/heave/src/fun/sqlite_init_db.rs b/01.workspace/heave/src/fun/sqlite_init_db.rs index c367ebe..e0c3477 100644 --- a/01.workspace/heave/src/fun/sqlite_init_db.rs +++ b/01.workspace/heave/src/fun/sqlite_init_db.rs @@ -28,6 +28,6 @@ pub fn run(path: &path::Path) -> result::Result<(), FailedTo> { let connection = Connection::open(path).map_err(|_| sqlite::FailedTo::OpenConnection)?; connection .execute_batch(init_statement) - .map_err(|_| sqlite::FailedTo::ExecuteBatch)?; + .map_err(|sqlite_error| sqlite::FailedTo::ExecuteBatch(sqlite_error))?; Ok(()) } diff --git a/01.workspace/heave/src/str/sqlite_failed_to.rs b/01.workspace/heave/src/str/sqlite_failed_to.rs index 1ba45ed..5bff5e4 100644 --- a/01.workspace/heave/src/str/sqlite_failed_to.rs +++ b/01.workspace/heave/src/str/sqlite_failed_to.rs @@ -8,7 +8,7 @@ pub enum FailedTo { /// Failed to commit a database transaction. CommitTransaction(rusqlite::Error), /// Failed to execute a batch of SQL statements. - ExecuteBatch, + ExecuteBatch(rusqlite::Error), /// Failed to execute a SQL query. ExecuteQuery, /// Failed to execute a prepared SQL statement.