[][src]Enum hdbconnect::HdbError

pub enum HdbError {
    Conversion(ConversionError),
    Deserialization(DeserializationError),
    DbError(ServerError),
    DbIssue(String),
    MixedResults(Vec<ExecutionResult>),
    Cesu8(Cesu8DecodingError),
    Evaluation(String),
    Impl(String),
    Io(Error),
    Poison(String),
    Serialization(SerializationError),
    Usage(String),
}

Represents all possible errors that can occur in hdbconnect.

Variants

Conversion(ConversionError)

Conversion of single db value to rust type failed.

Deserialization(DeserializationError)

Error occured in deserialization of data structures into an application-defined structure.

DbError(ServerError)

Database server responded with an error.

DbIssue(String)

Database server has a severe issue.

MixedResults(Vec<ExecutionResult>)

Database server responded with at least one error.

Cesu8(Cesu8DecodingError)

Some error occured while reading CESU-8.

Evaluation(String)

Error occured while evaluating a HdbResponse object.

Impl(String)

Missing or wrong implementation of HANA's wire protocol.

Io(Error)

IO error occured in communication with the database.

Poison(String)

Error occured in thread synchronization.

Serialization(SerializationError)

Error occured in serialization of rust data into values for the database.

Usage(String)

Error due to wrong usage of API.

Methods

impl HdbError[src]

pub fn server_error(&self) -> Option<&ServerError>[src]

Return the contained server_error, if any.

This method helps in case you need programmatic access to e.g. the error code.

Example:

    if let Err(hdberror) = hdb_result {
        if let Some(server_error) = hdberror.server_error() {
            let sys_m_error_code: (i32, String, String) = connection
                .query(&format!(
                    "select * from SYS.M_ERROR_CODES where code = {}",
                    server_error.code()
                ))?.try_into()?;
            println!("sys_m_error_code: {:?}", sys_m_error_code);
        }
    }

Trait Implementations

impl From<ConversionError> for HdbError[src]

impl From<DeserializationError> for HdbError[src]

impl From<SerializationError> for HdbError[src]

impl From<String> for HdbError[src]

impl From<Error> for HdbError[src]

impl From<Error> for HdbError[src]

impl From<Cesu8DecodingError> for HdbError[src]

impl<'a, T> From<PoisonError<MutexGuard<'a, T>>> for HdbError[src]

impl From<HdbError> for DeserializationError[src]

impl From<HdbError> for RmError[src]

impl Display for HdbError[src]

impl Debug for HdbError[src]

impl Error for HdbError[src]

fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0
[src]

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

Auto Trait Implementations

impl Send for HdbError

impl Sync for HdbError

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self