Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ErrorCodeExceptionTranslator.TranslateException Method

Subclasses can override this method to attempt a custom mapping from a data access Exception to DataAccessException.

[Visual Basic]
Protected Overridable Sub TranslateException( _
   ByVal task As String, _
   ByVal sql As String, _
   ByVal errorCode As String, _
   ByVal exception As Exception _
)
[C#]
protected virtual DataAccessException TranslateException(
   string task,
   string sql,
   string errorCode,
   Exception exception
);

Parameters

task
Readable text describing the task being attempted.
sql
SQL query or update that caused the problem. May be
null
.
errorCode
The error code extracted from the generic data access exception for a particular provider.
exception
The exception thrown from a data access operation.

Return Value

null if no custom translation was possible, otherwise a DataAccessException resulting from custom translation. This exception should include the exception parameter as a nested root cause. This implementation always returns null, meaning that the translator always falls back to the default error codes.

See Also

ErrorCodeExceptionTranslator Class | Spring.Data.Support Namespace