Expand description
Error types for the Senzing Rust SDK
This module defines a comprehensive error hierarchy that mirrors the
Senzing C# SDK exception hierarchy while leveraging Rust’s Result<T, E>
types.
The error system provides detailed error information from the underlying
Senzing C library with proper error chains and backtrace support. When errors
occur, the SDK automatically calls the appropriate getLastException
function
to retrieve detailed error messages from the native library.
§Error Categories
SzError::Configuration
- Configuration and setup errorsSzError::BadInput
- Invalid input parameters or dataSzError::Database
- Database connection or operation errorsSzError::NotFound
- Resource or entity not foundSzError::Retryable
- Temporary errors that can be retriedSzError::Unrecoverable
- Fatal errors requiring reinitializationSzError::License
- Licensing issuesSzError::NotInitialized
- System not initialized errorsSzError::DatabaseConnectionLost
- Database connectivity lostSzError::DatabaseTransient
- Temporary database issuesSzError::ReplaceConflict
- Data replacement conflictsSzError::RetryTimeoutExceeded
- Retry timeout exceededSzError::Unhandled
- Unhandled errorsSzError::UnknownDataSource
- Unknown data source errorsSzError::Unknown
- Unexpected or unclassified errors
§Examples
use sz_rust_sdk::error::{SzError, SzResult};
fn example_function() -> SzResult<String> {
// This would normally come from a Senzing operation
Err(SzError::configuration("Database not initialized"))
}
match example_function() {
Ok(result) => println!("Success: {}", result),
Err(SzError::Configuration { message, .. }) => {
eprintln!("Configuration error: {}", message);
}
Err(e) => eprintln!("Other error: {}", e),
}
Enums§
- SzComponent
- Senzing SDK component for error reporting
- SzError
- Base error type for all Senzing SDK operations
Functions§
- c_
str_ 🔒 ⚠to_ sz_ error - Utility function to convert C string errors to SzError (Internal)
Type Aliases§
- SzResult
- Result type alias for Senzing SDK operations