#[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),
#[non_exhaustive] 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)
Use kind() to check the error category. Use db_error() to get DbError.
Error from an underlying Oracle client library.
DpiError(DbError)
Use kind() to check the error category. Use db_error() to get DbError.
Error from an underlying ODPI-C layer.
NullValue
Use kind() to check the error category.
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>)
Use kind() to check the error category. Use source() to get the underlying error.
Error when conversion from a string to an Oracle value fails
OutOfRange(String)
Use kind() to check the error category. Use to_string() to get the message.
Error when conversion from a type to another fails due to out-of-range
InvalidTypeConversion(String, String)
Use kind() to check the error category.
Error when conversion from a type to another is not allowed.
InvalidArgument
Error when an unacceptable argument is passed
Fields
InvalidBindIndex(usize)
Use kind() to check the error category.
Error when the bind parameter index is out of range. (one based)
InvalidBindName(String)
Use kind() to check the error category.
Error when the bind parameter name is not in the SQL.
InvalidColumnIndex(usize)
Use kind() to check the error category.
Error when the column index is out of range. (zero based)
InvalidColumnName(String)
Use kind() to check the error category.
Error when the column name is not in the SQL.
InvalidAttributeName(String)
Use kind() to check the error category.
Error when the specified attribute name is not found.
InvalidOperation(String)
Use kind() to check the error category. Use to_string() to get the message.
Error when invalid method is called such as calling execute for select statements.
UninitializedBindValue
Use kind() to check the error category.
Error when an uninitialized bind value is accessed. Bind values
must be initialized by Statement::bind, Statement::execute
or Connection::execute in advance.
NoDataFound
Use kind() to check the error category.
Error when no more rows exist in the SQL.
BatchErrors(Vec<DbError>)
Use kind() to check the error category. Use batch_errors() to get the db errors.
InternalError(String)
Use kind() to check the error category. Use to_string() to get the message.
Internal error. When you get this error, please report it with a test case to reproduce it.
#[non_exhaustive]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”
Trait Implementations§
Source§impl Error for Error
Available on non-crate feature struct_error only.
impl Error for Error
struct_error only.Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()