Enum oracle::Error

source ·
#[non_exhaustive]
pub enum Error {
Show 16 variants OciError(DbError), DpiError(DbError), NullValue, ParseError(Box<dyn Error + Send + Sync>), OutOfRange(String), InvalidTypeConversion(String, String), InvalidBindIndex(usize), InvalidBindName(String), InvalidColumnIndex(usize), InvalidColumnName(String), InvalidAttributeName(String), InvalidOperation(String), UninitializedBindValue, NoDataFound, BatchErrors(Vec<DbError>), InternalError(String),
}
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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

OciError(DbError)

👎Deprecated: Use kind() to check the error category. Use db_error() to get DbError.

Error from an underlying Oracle client library.

§

DpiError(DbError)

👎Deprecated: Use kind() to check the error category. Use db_error() to get DbError.

Error from an underlying ODPI-C layer.

§

NullValue

👎Deprecated: 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>)

👎Deprecated: 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)

👎Deprecated: 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)

👎Deprecated: Use kind() to check the error category.

Error when conversion from a type to another is not allowed.

§

InvalidBindIndex(usize)

👎Deprecated: Use kind() to check the error category.

Error when the bind parameter index is out of range. (one based)

§

InvalidBindName(String)

👎Deprecated: Use kind() to check the error category.

Error when the bind parameter name is not in the SQL.

§

InvalidColumnIndex(usize)

👎Deprecated: Use kind() to check the error category.

Error when the column index is out of range. (zero based)

§

InvalidColumnName(String)

👎Deprecated: Use kind() to check the error category.

Error when the column name is not in the SQL.

§

InvalidAttributeName(String)

👎Deprecated: Use kind() to check the error category.

Error when the specified attribute name is not found.

§

InvalidOperation(String)

👎Deprecated: 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

👎Deprecated: 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

👎Deprecated: Use kind() to check the error category.

Error when no more rows exist in the SQL.

§

BatchErrors(Vec<DbError>)

👎Deprecated: Use kind() to check the error category. Use batch_errors() to get the db errors.
§

InternalError(String)

👎Deprecated: 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.

Implementations§

source§

impl Error

source

pub fn kind(&self) -> ErrorKind

Returns the corresponding ErrorKind for this error.

source

pub fn db_error(&self) -> Option<&DbError>

Returns DbError.

source

pub fn batch_errors(&self) -> Option<&Vec<DbError>>

Returns batch errors. See “Error Handling with batch errors”

source

pub fn oci_code(&self) -> Option<i32>

Returns Oracle error code. For example 1 for “ORA-0001: unique constraint violated”

source

pub fn dpi_code(&self) -> Option<i32>

Returns ODPI-C error code.

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ParseFloatError> for Error

source§

fn from(err: ParseFloatError) -> Self

Converts to this type from the input type.
source§

impl From<ParseIntError> for Error

source§

fn from(err: ParseIntError) -> Self

Converts to this type from the input type.
source§

impl From<ParseOracleTypeError> for Error

source§

fn from(err: ParseOracleTypeError) -> Self

Converts to this type from the input type.
source§

impl<T> From<PoisonError<T>> for Error

source§

fn from(err: PoisonError<T>) -> Self

Converts to this type from the input type.
source§

impl From<TryFromIntError> for Error

source§

fn from(err: TryFromIntError) -> Self

Converts to this type from the input type.
source§

impl From<Utf8Error> for Error

source§

fn from(err: Utf8Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.