#[non_exhaustive]pub enum HdbError {
Show 21 variants
Initialization {
source: Box<dyn Error + Send + Sync>,
},
Authentication {
source: Box<HdbError>,
},
Deserialization {
source: DeserializationError,
},
Serialization {
source: SerializationError,
},
Cesu8,
Cesu8AsBytes {
bytes: Vec<u8>,
},
ConnParams {
source: Box<dyn Error + Send + Sync + 'static>,
},
DbError {
source: ServerError,
},
Decompression {
source: DecompressError,
},
TlsInvalidDnsName {
source: InvalidDnsNameError,
},
TlsInit {
source: Box<dyn Error + Send + Sync>,
},
TlsProtocol {
source: Error,
},
Evaluation(&'static str),
ExecutionResults(ExecutionResults),
Impl(Cow<'static, str>),
Poison,
SessionClosingTransactionError,
Io {
source: Error,
},
ErrorAfterReconnect {
source: Error,
second: Box<HdbError>,
},
Usage(Cow<'static, str>),
ConnectionBroken {
source: Option<Box<HdbError>>,
},
}Expand description
A list specifying categories of HdbError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Initialization
Initialization without TLS failed.
Authentication
Authentication failed.
Deserialization
Deserialization of a ResultSet, a Row, a single HdbValue,
or an OutputParameter failed (methods try_into()).
Fields
source: DeserializationErrorThe causing Error.
Serialization
Serialization of a ParameterDescriptor or a ParameterRow failed.
Fields
source: SerializationErrorThe causing Error.
Cesu8
Some error occured while decoding CESU-8. This indicates a server issue!
Cesu8AsBytes
Decoding CESU-8 failed, original bytes are available.
ConnParams
Erroneous Connection Parameters, e.g. from a malformed connection URL.
DbError
Database server responded with an error;
the contained ServerError describes the conrete reason.
Fields
source: ServerErrorThe causing Error.
Decompression
Decompression
Fields
source: DecompressErrorThe causing Error.
TlsInvalidDnsName
TLS set up failed because the server name was not valid.
Fields
source: InvalidDnsNameErrorThe causing Error.
TlsInit
TLS initialization error
TlsProtocol
TLS protocol error.
Evaluation(&'static str)
Error occured while evaluating an HdbResponse or an HdbReturnValue.
ExecutionResults(ExecutionResults)
Database server responded with at least one error.
Impl(Cow<'static, str>)
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.
ErrorAfterReconnect
Error occured
Usage(Cow<'static, str>)
Error caused by wrong usage.
ConnectionBroken
Connection is dead
Implementations§
Source§impl HdbError
impl HdbError
Sourcepub fn server_error(&self) -> Option<&ServerError>
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);
}
}Sourcepub fn display_with_inner(&self) -> String
pub fn display_with_inner(&self) -> String
Returns a decently formed and hopefully helpful error description.