[][src]Enum hdbconnect::HdbError

pub enum HdbError {
    Deserialization {
        source: DeserializationError,
    },
    Serialization {
        source: SerializationError,
    },
    Cesu8 {
        source: Cesu8DecodingError,
    },
    ConnParams {
        source: Box<dyn Error>,
    },
    DbError {
        source: ServerError,
    },
    Evaluation(&'static str),
    ExecutionResults(Vec<ExecutionResult>),
    LobStreaming(Error),
    Impl(&'static str),
    ImplDetailed(String),
    Poison,
    SessionClosingTransactionError,
    Tcp {
        source: Error,
    },
    Usage(&'static str),
    UsageDetailed(String),
}

A list specifying categories of HdbError.

This list may grow over time and it is not recommended to exhaustively match against it.

Variants

Deserialization

Error occured in deserialization.

Fields of Deserialization

source: DeserializationError

The causing Error.

Serialization

Error occured in serialization.

Fields of Serialization

source: SerializationError

The causing Error.

Cesu8

Some error occured while decoding CESU-8.

Fields of Cesu8

source: Cesu8DecodingError

The causing Error.

ConnParams

Erroneous Connection Parameters.

Fields of ConnParams

source: Box<dyn Error>

The causing Error.

DbError

Database server responded with an error.

Fields of DbError

source: ServerError

The causing Error.

Evaluation(&'static str)

Error occured while evaluating a HdbResponse or an HdbReturnValue.

ExecutionResults(Vec<ExecutionResult>)

Database server responded with at least one error.

LobStreaming(Error)

Error occured while streaming a LOB.

Impl(&'static str)

Implementation error.

ImplDetailed(String)

Implementation error.

Poison

Error occured in thread synchronization.

SessionClosingTransactionError

An error occurred on the server that requires the session to be terminated.

Tcp

Error occured in communication with the database.

Fields of Tcp

source: Error

The causing Error.

Usage(&'static str)

Error caused by wrong usage.

UsageDetailed(String)

Error caused by wrong usage.

Methods

impl HdbError[src]

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

Returns the contained ServerError, 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 Debug for HdbError[src]

impl Display for HdbError[src]

impl Error for HdbError[src]

impl From<Cesu8DecodingError> for HdbError[src]

impl From<DeserializationError> for HdbError[src]

impl From<Error> for HdbError[src]

impl From<HdbError> for DeserializationError[src]

impl From<HdbError> for RmError[src]

impl<G> From<PoisonError<G>> for HdbError[src]

impl From<SerializationError> for HdbError[src]

impl From<ServerError> for HdbError[src]

Auto Trait Implementations

impl !RefUnwindSafe for HdbError

impl !Send for HdbError

impl !Sync for HdbError

impl Unpin for HdbError

impl !UnwindSafe for HdbError

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<V, T> VZip<V> for T where
    V: MultiLane<T>,