pub enum SzError {
Show 18 variants
BadInput {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Configuration {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Database {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
License {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
NotFound {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Retryable {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Unrecoverable {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Unknown {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
NotInitialized {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
DatabaseConnectionLost {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
DatabaseTransient {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
ReplaceConflict {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
RetryTimeoutExceeded {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Unhandled {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
UnknownDataSource {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Ffi {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Json(Error),
StringConversion(NulError),
}
Expand description
Base error type for all Senzing SDK operations
This enum represents all possible errors that can occur when using the Senzing SDK. Each variant corresponds to a specific category of error returned by the underlying Senzing C library.
The error hierarchy is designed to match the Senzing C# SDK for consistency across language bindings.
Variants§
BadInput
Errors related to invalid input parameters
Configuration
Configuration-related errors
Database
Database operation errors
License
License-related errors
NotFound
Resource not found errors
Retryable
Errors that indicate the operation should be retried
Unrecoverable
Unrecoverable errors that require reinitialization
Unknown
Unknown or unexpected errors
NotInitialized
System not initialized errors
DatabaseConnectionLost
Database connection lost errors
DatabaseTransient
Database transient errors
ReplaceConflict
Replace conflict errors
RetryTimeoutExceeded
Retry timeout exceeded errors
Unhandled
Unhandled errors
UnknownDataSource
Unknown data source errors
Ffi
FFI-related errors
Json(Error)
JSON serialization/deserialization errors
StringConversion(NulError)
String conversion errors (C string handling)
Implementations§
Source§impl SzError
impl SzError
Sourcepub fn configuration<S: Into<String>>(message: S) -> Self
pub fn configuration<S: Into<String>>(message: S) -> Self
Creates a new Configuration error
Sourcepub fn unrecoverable<S: Into<String>>(message: S) -> Self
pub fn unrecoverable<S: Into<String>>(message: S) -> Self
Creates a new Unrecoverable error
Sourcepub fn not_initialized<S: Into<String>>(message: S) -> Self
pub fn not_initialized<S: Into<String>>(message: S) -> Self
Creates a new NotInitialized error
Sourcepub fn database_connection_lost<S: Into<String>>(message: S) -> Self
pub fn database_connection_lost<S: Into<String>>(message: S) -> Self
Creates a new DatabaseConnectionLost error
Sourcepub fn database_transient<S: Into<String>>(message: S) -> Self
pub fn database_transient<S: Into<String>>(message: S) -> Self
Creates a new DatabaseTransient error
Sourcepub fn replace_conflict<S: Into<String>>(message: S) -> Self
pub fn replace_conflict<S: Into<String>>(message: S) -> Self
Creates a new ReplaceConflict error
Sourcepub fn retry_timeout_exceeded<S: Into<String>>(message: S) -> Self
pub fn retry_timeout_exceeded<S: Into<String>>(message: S) -> Self
Creates a new RetryTimeoutExceeded error
Sourcepub fn unknown_data_source<S: Into<String>>(message: S) -> Self
pub fn unknown_data_source<S: Into<String>>(message: S) -> Self
Creates a new UnknownDataSource error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if this error indicates the operation should be retried
Sourcepub fn is_unrecoverable(&self) -> bool
pub fn is_unrecoverable(&self) -> bool
Returns true if this error is unrecoverable
Sourcepub fn from_code_with_message(error_code: i64, component: SzComponent) -> Self
pub fn from_code_with_message(error_code: i64, component: SzComponent) -> Self
Creates an error from getLastExceptionCode() with message from getLastException()
Sourcefn get_last_exception_message(component: SzComponent, error_code: i64) -> String
fn get_last_exception_message(component: SzComponent, error_code: i64) -> String
Gets the last exception message from the specified component
Sourcepub fn from_code(error_code: i64) -> Self
pub fn from_code(error_code: i64) -> Self
Creates an error from getLastExceptionCode() (legacy method for compatibility)