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:
John Gallagher
2015-12-13 00:54:08 -05:00
parent b385ae002b
commit aac4d59fcc
7 changed files with 241 additions and 241 deletions

View File

@@ -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`.