mirror of
https://github.com/isar/rusqlite.git
synced 2025-03-29 09:02:57 +08:00
Implement std::error::Error::source instead of cause (#683)
This commit is contained in:
parent
802eb669c3
commit
5ef73f6c8c
@ -21,7 +21,7 @@ pub enum Error {
|
|||||||
|
|
||||||
/// Error when the value of a particular column is requested, but it cannot
|
/// Error when the value of a particular column is requested, but it cannot
|
||||||
/// be converted to the requested Rust type.
|
/// be converted to the requested Rust type.
|
||||||
FromSqlConversionFailure(usize, Type, Box<dyn error::Error + Send + Sync>),
|
FromSqlConversionFailure(usize, Type, Box<dyn error::Error + Send + Sync + 'static>),
|
||||||
|
|
||||||
/// Error when SQLite gives us an integral value outside the range of the
|
/// Error when SQLite gives us an integral value outside the range of the
|
||||||
/// requested type (e.g., trying to get the value 1000 into a `u8`).
|
/// requested type (e.g., trying to get the value 1000 into a `u8`).
|
||||||
@ -80,10 +80,10 @@ pub enum Error {
|
|||||||
/// `create_scalar_function`).
|
/// `create_scalar_function`).
|
||||||
#[cfg(feature = "functions")]
|
#[cfg(feature = "functions")]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
UserFunctionError(Box<dyn error::Error + Send + Sync>),
|
UserFunctionError(Box<dyn error::Error + Send + Sync + 'static>),
|
||||||
|
|
||||||
/// Error available for the implementors of the `ToSql` trait.
|
/// Error available for the implementors of the `ToSql` trait.
|
||||||
ToSqlConversionFailure(Box<dyn error::Error + Send + Sync>),
|
ToSqlConversionFailure(Box<dyn error::Error + Send + Sync + 'static>),
|
||||||
|
|
||||||
/// Error when the SQL is not a `SELECT`, is not read-only.
|
/// Error when the SQL is not a `SELECT`, is not read-only.
|
||||||
InvalidQuery,
|
InvalidQuery,
|
||||||
@ -308,7 +308,7 @@ impl error::Error for Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cause(&self) -> Option<&dyn error::Error> {
|
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||||
match *self {
|
match *self {
|
||||||
Error::SqliteFailure(ref err, _) => Some(err),
|
Error::SqliteFailure(ref err, _) => Some(err),
|
||||||
Error::Utf8Error(ref err) => Some(err),
|
Error::Utf8Error(ref err) => Some(err),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user