From 1af3fcd0539a7699ae13d7707d62d6d2f5585491 Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Tue, 1 Dec 2015 11:47:55 -0500 Subject: [PATCH] Fix error messages when failing to convert paths and strings to C-compatible versions --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cae3c59..364d6d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -128,14 +128,14 @@ impl SqliteError { fn str_to_cstring(s: &str) -> SqliteResult { CString::new(s).map_err(|_| SqliteError{ code: ffi::SQLITE_MISUSE, - message: "Could not convert path to C-combatible string".to_string() + message: format!("Could not convert string {} to C-combatible string", s), }) } fn path_to_cstring(p: &Path) -> SqliteResult { let s = try!(p.to_str().ok_or(SqliteError{ code: ffi::SQLITE_MISUSE, - message: "Could not convert path to UTF-8 string".to_string() + message: format!("Could not convert path {} to UTF-8 string", p.to_string_lossy()), })); str_to_cstring(s) }