mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-03 23:48:56 +08:00
Change Error from a struct to an enum (BREAKING CHANGE).
This allows us to separate out the underlying SQLite error codes from errors that occur on the Rust side.
This commit is contained in:
11
src/trace.rs
11
src/trace.rs
@@ -42,14 +42,11 @@ pub unsafe fn config_log(callback: Option<fn(c_int, &str)>) -> Result<()> {
|
||||
}
|
||||
};
|
||||
|
||||
if rc != ffi::SQLITE_OK {
|
||||
return Err(Error {
|
||||
code: rc,
|
||||
message: "sqlite3_config(SQLITE_CONFIG_LOG, ...)".to_string(),
|
||||
});
|
||||
if rc == ffi::SQLITE_OK {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::from_sqlite_code(rc, None))
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Write a message into the error log established by `config_log`.
|
||||
|
||||
Reference in New Issue
Block a user