From 6d6ac66f4dff483f8875eb3c04992263e4d0dc03 Mon Sep 17 00:00:00 2001 From: Hocuri Date: Wed, 16 Sep 2020 17:24:04 +0200 Subject: [PATCH] Show dbfile when opening fails --- src/sql.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql.rs b/src/sql.rs index 137155125..89e281bcb 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -84,7 +84,7 @@ impl Sql { dbfile: T, readonly: bool, ) -> crate::error::Result<()> { - let res = open(context, self, dbfile, readonly).await; + let res = open(context, self, &dbfile, readonly).await; if let Err(err) = &res { match err.downcast_ref::() { Some(Error::SqlAlreadyOpen) => {} @@ -93,7 +93,7 @@ impl Sql { } } } - res.map_err(|e| format_err!("Could not open db: {}", e)) + res.map_err(|e| format_err!("Could not open db file {}: {}", dbfile.as_ref().to_string_lossy(), e)) } pub async fn execute>(