# Class Extensions OptimaJet.Workflow.SQLite.Extensions Extension methods for SQLite exception handling. Namespace: [OptimaJet.Workflow.SQLite](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/) ```csharp public static class Extensions ``` ## 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 | | --- | --- | --- | | `exception` | `Exception` | The exception to convert. | | `suppressRetry` | `Boolean` | If set to `true`, the resulting exception will not allow retry. | ### Returns | Type | Description | | --- | --- | | `PersistenceProviderQueryException` | A 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 | | --- | --- | --- | | `exception` | `PersistenceProviderQueryException` | The exception to check. | ### Returns | Type | Description | | --- | --- | | `Boolean` | `true` if the inner exception is a SQLite duplicate key error (error code 19); otherwise, `false`. | [Previous DbObject](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/DbObject-TEntity/) [Next FileSchemePersistenceSqliteProvider](https://api.workflowengine.io/sqlite/OptimaJet.Workflow.SQLite/FileSchemePersistenceSqliteProvider/)