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 + Sync + Send>,
},
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
Authentication
Authentication failed.
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.
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: 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
TlsProtocol
TLS protocol 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.
ErrorAfterReconnect
Error occured
Usage(&'static str)
Error caused by wrong usage.
UsageDetailed(String)
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.