Skip to main content
Version: 2025

WhenSqlError

Namespace: PPJ.Runtime.Sql

Assembly: PPJ.Web.50 (5.0.0.0)

Temporarily suppresses global SQL error dispatch while a translated local SQL error block runs.

public class WhenSqlError : IDisposable

Construction increments the current runtime globals nesting count; disposal decrements it. Dispose each instance exactly once in the same runtime context. This scope does not catch exceptions or provide an error handler.

Example:

using PPJ.Runtime.Sql;

using (new WhenSqlError())
{
// Execute SQL operations with the translated local error handling.
}

Constructors

Instance member WhenSqlError()

Begins a global SQL error suppression scope in the current runtime context.

Methods

Instance member Dispose()

Ends one global SQL error suppression scope.

This method does not guard against repeated disposal.