Enum SzError

Source
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

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Configuration

Configuration-related errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Database

Database operation errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

License

License-related errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

NotFound

Resource not found errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Retryable

Errors that indicate the operation should be retried

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Unrecoverable

Unrecoverable errors that require reinitialization

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Unknown

Unknown or unexpected errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

NotInitialized

System not initialized errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

DatabaseConnectionLost

Database connection lost errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

DatabaseTransient

Database transient errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

ReplaceConflict

Replace conflict errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

RetryTimeoutExceeded

Retry timeout exceeded errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Unhandled

Unhandled errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

UnknownDataSource

Unknown data source errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Ffi

FFI-related errors

Fields

§message: String
§source: Option<Box<dyn Error + Send + Sync>>
§

Json(Error)

JSON serialization/deserialization errors

§

StringConversion(NulError)

String conversion errors (C string handling)

Implementations§

Source§

impl SzError

Source

pub fn bad_input<S: Into<String>>(message: S) -> Self

Creates a new BadInput error

Source

pub fn configuration<S: Into<String>>(message: S) -> Self

Creates a new Configuration error

Source

pub fn database<S: Into<String>>(message: S) -> Self

Creates a new Database error

Source

pub fn license<S: Into<String>>(message: S) -> Self

Creates a new License error

Source

pub fn not_found<S: Into<String>>(message: S) -> Self

Creates a new NotFound error

Source

pub fn retryable<S: Into<String>>(message: S) -> Self

Creates a new Retryable error

Source

pub fn unrecoverable<S: Into<String>>(message: S) -> Self

Creates a new Unrecoverable error

Source

pub fn unknown<S: Into<String>>(message: S) -> Self

Creates a new Unknown error

Source

pub fn ffi<S: Into<String>>(message: S) -> Self

Creates a new FFI error

Source

pub fn not_initialized<S: Into<String>>(message: S) -> Self

Creates a new NotInitialized error

Source

pub fn database_connection_lost<S: Into<String>>(message: S) -> Self

Creates a new DatabaseConnectionLost error

Source

pub fn database_transient<S: Into<String>>(message: S) -> Self

Creates a new DatabaseTransient error

Source

pub fn replace_conflict<S: Into<String>>(message: S) -> Self

Creates a new ReplaceConflict error

Source

pub fn retry_timeout_exceeded<S: Into<String>>(message: S) -> Self

Creates a new RetryTimeoutExceeded error

Source

pub fn unhandled<S: Into<String>>(message: S) -> Self

Creates a new Unhandled error

Source

pub fn unknown_data_source<S: Into<String>>(message: S) -> Self

Creates a new UnknownDataSource error

Source

pub fn is_retryable(&self) -> bool

Returns true if this error indicates the operation should be retried

Source

pub fn is_unrecoverable(&self) -> bool

Returns true if this error is unrecoverable

Source

pub fn from_code_with_message(error_code: i64, component: SzComponent) -> Self

Creates an error from getLastExceptionCode() with message from getLastException()

Source

fn get_last_exception_message(component: SzComponent, error_code: i64) -> String

Gets the last exception message from the specified component

Source

pub fn from_code(error_code: i64) -> Self

Creates an error from getLastExceptionCode() (legacy method for compatibility)

Source

pub fn from_source(source: Box<dyn Error + Send + Sync>) -> Self

Creates an Unknown error from a source error

Source

pub fn with_message_and_source<S: Into<String>>( message: S, source: Box<dyn Error + Send + Sync>, ) -> Self

Creates an Unknown error with a custom message and source

Trait Implementations§

Source§

impl Debug for SzError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for SzError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for SzError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for SzError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<NulError> for SzError

Source§

fn from(source: NulError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.