Class Extensions
OptimaJet.Workflow.SQLite.Extensions
Extension methods for SQLite exception handling.
Namespace: OptimaJet.Workflow.SQLite
public static class ExtensionsInheritance
- Object
Methods
public static PersistenceProviderQueryException ToQueryException(this Exception exception, bool suppressRetry = false) #Converts an exception to a PersistenceProviderQueryException, preserving retry information if the original exception is already a PersistenceProviderQueryException.
Parameters
Name
Type
Description
exceptionExceptionThe exception to convert.
suppressRetryBooleanIf set to
true, the resulting exception will not allow retry.Returns
Type
Description
PersistenceProviderQueryExceptionA PersistenceProviderQueryException wrapping the original exception.
public static bool IsDuplicateKeyException(this PersistenceProviderQueryException exception) #Determines whether the specified PersistenceProviderQueryException is caused by a duplicate key violation.
Parameters
Name
Type
Description
exceptionPersistenceProviderQueryExceptionThe exception to check.
Returns
Type
Description
Booleantrue if the inner exception is a SQLite duplicate key error (error code 19); otherwise, false.