Merge branch 'master' into gwenn-invalid-column-type

This commit is contained in:
John Gallagher
2016-12-31 00:35:47 -05:00
21 changed files with 497 additions and 352 deletions

View File

@@ -7,6 +7,7 @@ use {ffi, errmsg_to_string};
use types::Type;
/// Old name for `Error`. `SqliteError` is deprecated.
#[deprecated(since = "0.6.0", note = "Use Error instead")]
pub type SqliteError = Error;
/// Enum listing possible errors from rusqlite.
@@ -57,10 +58,6 @@ pub enum Error {
/// Error when a query that was expected to insert one row did not insert any or insert many.
StatementChangedRows(c_int),
/// Error when a query that was expected to insert a row did not change the connection's
/// last_insert_rowid().
StatementFailedToInsertRow,
/// Error returned by `functions::Context::get` when the function argument cannot be converted
/// to the requested type.
#[cfg(feature = "functions")]
@@ -115,7 +112,6 @@ impl fmt::Display for Error {
write!(f, "Invalid column type {} at index: {}", t, i)
}
Error::StatementChangedRows(i) => write!(f, "Query changed {} rows", i),
Error::StatementFailedToInsertRow => write!(f, "Statement failed to insert new row"),
#[cfg(feature = "functions")]
Error::InvalidFunctionParameterType(i, ref t) => {
@@ -148,7 +144,6 @@ impl error::Error for Error {
Error::InvalidColumnName(_) => "invalid column name",
Error::InvalidColumnType(_, _) => "invalid column type",
Error::StatementChangedRows(_) => "query inserted zero or more than one row",
Error::StatementFailedToInsertRow => "statement failed to insert new row",
#[cfg(feature = "functions")]
Error::InvalidFunctionParameterType(_, _) => "invalid function parameter type",
@@ -173,8 +168,7 @@ impl error::Error for Error {
Error::InvalidColumnName(_) |
Error::InvalidColumnType(_, _) |
Error::InvalidPath(_) |
Error::StatementChangedRows(_) |
Error::StatementFailedToInsertRow => None,
Error::StatementChangedRows(_) => None,
#[cfg(feature = "functions")]
Error::InvalidFunctionParameterType(_, _) => None,