#[non_exhaustive]pub enum Error {
Show 18 variants
OciError(DbError),
DpiError(DbError),
NullValue,
ParseError(Box<dyn Error + Send + Sync>),
OutOfRange(String),
InvalidTypeConversion(String, String),
InvalidArgument {
message: Cow<'static, str>,
source: Option<Box<dyn Error + Send + Sync>>,
},
InvalidBindIndex(usize),
InvalidBindName(String),
InvalidColumnIndex(usize),
InvalidColumnName(String),
InvalidAttributeName(String),
InvalidOperation(String),
UninitializedBindValue,
NoDataFound,
BatchErrors(Vec<DbError>),
InternalError(String),
Other {
kind: ErrorKind,
message: Cow<'static, str>,
source: Option<Box<dyn Error + Send + Sync>>,
},
}
Expand description
The error type for oracle
Note: This enum will be changed to struct in the future.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
OciError(DbError)
Error from an underlying Oracle client library.
DpiError(DbError)
Error from an underlying ODPI-C layer.
NullValue
Error when NULL value is got but the target rust type cannot handle NULL.
Use Option<...>
in this case.
ParseError(Box<dyn Error + Send + Sync>)
Error when conversion from a string to an Oracle value fails
OutOfRange(String)
Error when conversion from a type to another fails due to out-of-range
InvalidTypeConversion(String, String)
Error when conversion from a type to another is not allowed.
InvalidArgument
Error when an unacceptable argument is passed
Fields
InvalidBindIndex(usize)
Error when the bind parameter index is out of range. (one based)
InvalidBindName(String)
Error when the bind parameter name is not in the SQL.
InvalidColumnIndex(usize)
Error when the column index is out of range. (zero based)
InvalidColumnName(String)
Error when the column name is not in the SQL.
InvalidAttributeName(String)
Error when the specified attribute name is not found.
InvalidOperation(String)
Error when invalid method is called such as calling execute for select statements.
UninitializedBindValue
Error when an uninitialized bind value is accessed. Bind values
must be initialized by Statement::bind
, Statement::execute
or Connection::execute
in advance.
NoDataFound
Error when no more rows exist in the SQL.
BatchErrors(Vec<DbError>)
InternalError(String)
Internal error. When you get this error, please report it with a test case to reproduce it.
Other
Other or newly added error
Don’t use this variant directly.
Fields
This variant is marked as non-exhaustive
Implementations§
Source§impl Error
impl Error
Sourcepub fn add_source<E>(self, source: E) -> Error
pub fn add_source<E>(self, source: E) -> Error
Add the lower-level error used as the return value of Error::source()
.
Note: This is intended to be applied to the Error created by Error::new()
.
Otherwise, source
may be ignored.
Sourcepub fn with_source<E>(kind: ErrorKind, source: E) -> Error
pub fn with_source<E>(kind: ErrorKind, source: E) -> Error
Create a new error from an arbitrary error
The error message of this error is same with that of the source specified.
This is a shortcut for Error::new(kind, "").add_source(source)
.
Sourcepub fn batch_errors(&self) -> Option<&Vec<DbError>>
pub fn batch_errors(&self) -> Option<&Vec<DbError>>
Returns batch errors. See “Error Handling with batch errors”