mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
Merge pull request #90 from jgallagher/fix-str-error-messages
Fix error messages when failing to convert paths and strings to C-compatible versions
This commit is contained in:
commit
9a4503ad5f
@ -128,14 +128,14 @@ impl SqliteError {
|
||||
fn str_to_cstring(s: &str) -> SqliteResult<CString> {
|
||||
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<CString> {
|
||||
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user