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

@@ -133,10 +133,7 @@ impl<'conn> Statement<'conn> {
if let Some(i) = try!(self.parameter_index(name)) {
try!(self.conn.decode_result(unsafe { value.bind_parameter(self.stmt, i) }));
} else {
return Err(Error {
code: ffi::SQLITE_MISUSE,
message: format!("Invalid parameter name: {}", name),
});
return Err(Error::InvalidParameterName(name.into()));
}
}
Ok(())