Module error

Source
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

§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