Enum hdbconnect::HdbError

source ·
#[non_exhaustive]
pub enum HdbError {
Show 22 variants Authentication { source: Box<HdbError>, }, Deserialization { source: DeserializationError, }, Serialization { source: SerializationError, }, Cesu8, Cesu8AsBytes { bytes: Vec<u8>, }, ConnParams { source: Box<dyn Error + Send + Sync>, }, DbError { source: ServerError, }, Decompression { source: DecompressError, }, TlsInvalidDnsName { source: InvalidDnsNameError, }, TlsInit { source: Error, }, TlsProtocol { source: Error, }, Evaluation(&'static str), ExecutionResults(Vec<ExecutionResult>), Impl(&'static str), ImplDetailed(String), Poison, SessionClosingTransactionError, Io { source: Error, }, ErrorAfterReconnect { source: Error, second: Box<HdbError>, }, Usage(&'static str), UsageDetailed(String), ConnectionBroken { source: Option<Box<HdbError>>, },
}
Expand description

A list specifying categories of HdbError.

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.
§

Authentication

Authentication failed.

Fields

§source: Box<HdbError>

The causing Error.

§

Deserialization

Deserialization of a ResultSet, a Row, a single HdbValue, or an OutputParameter failed (methods try_into()).

Fields

§source: DeserializationError

The causing Error.

§

Serialization

Serialization of a ParameterDescriptor or a ParameterRow failed.

Fields

§source: SerializationError

The causing Error.

§

Cesu8

Some error occured while decoding CESU-8. This indicates a server issue!

§

Cesu8AsBytes

Decoding CESU-8 failed, original bytes are available.

Fields

§bytes: Vec<u8>
§

ConnParams

Erroneous Connection Parameters, e.g. from a malformed connection URL.

Fields

§source: Box<dyn Error + Send + Sync>

The causing Error.

§

DbError

Database server responded with an error; the contained ServerError describes the conrete reason.

Fields

§source: ServerError

The causing Error.

§

Decompression

Decompression

Fields

§source: DecompressError

The causing Error.

§

TlsInvalidDnsName

TLS set up failed because the server name was not valid.

Fields

§source: InvalidDnsNameError

The causing Error.

§

TlsInit

TLS initialization error

Fields

§source: Error

The causing Error.

§

TlsProtocol

TLS protocol error.

Fields

§source: Error

The causing Error.

§

Evaluation(&'static str)

Error occured while evaluating an HdbResponse or an HdbReturnValue.

§

ExecutionResults(Vec<ExecutionResult>)

Database server responded with at least one error.

§

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.

§

Io

Error occured in communication with the database.

Fields

§source: Error

The causing Error.

§

ErrorAfterReconnect

Error occured

Fields

§source: Error
§second: Box<HdbError>
§

Usage(&'static str)

Error caused by wrong usage.

§

UsageDetailed(String)

Error caused by wrong usage.

§

ConnectionBroken

Connection is dead

Fields

Implementations§

source§

impl HdbError

source

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

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);
        }
    }
source

pub fn inner(&self) -> Option<&dyn Error>

Reveal the inner error

source

pub fn display_with_inner(&self) -> String

Returns a decently formed and hopefully helpful error description.

Trait Implementations§

source§

impl Debug for HdbError

source§

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

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

impl Display for HdbError

source§

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

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

impl Error for HdbError

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<Box<HdbError>> for HdbError

source§

fn from(source: Box<HdbError>) -> HdbError

Converts to this type from the input type.
source§

impl From<DecompressError> for HdbError

source§

fn from(source: DecompressError) -> HdbError

Converts to this type from the input type.
source§

impl From<DeserializationError> for HdbError

source§

fn from(source: DeserializationError) -> HdbError

Converts to this type from the input type.
source§

impl From<Error> for HdbError

source§

fn from(source: Error) -> HdbError

Converts to this type from the input type.
source§

impl From<Error> for HdbError

source§

fn from(source: Error) -> HdbError

Converts to this type from the input type.
source§

impl From<HdbError> for DeserializationError

source§

fn from(e: HdbError) -> DeserializationError

Converts to this type from the input type.
source§

impl From<InvalidDnsNameError> for HdbError

source§

fn from(source: InvalidDnsNameError) -> HdbError

Converts to this type from the input type.
source§

impl<G> From<PoisonError<G>> for HdbError

source§

fn from(_error: PoisonError<G>) -> HdbError

Converts to this type from the input type.
source§

impl From<SerializationError> for HdbError

source§

fn from(source: SerializationError) -> HdbError

Converts to this type from the input type.
source§

impl From<ServerError> for HdbError

source§

fn from(source: ServerError) -> HdbError

Converts to this type from the input type.

Auto Trait Implementations§

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> Same for T

§

type Output = T

Should always be Self
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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T