-
Notifications
You must be signed in to change notification settings - Fork 934
/
Copy pathISQLExceptionConverter.cs
28 lines (27 loc) · 1.05 KB
/
ISQLExceptionConverter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
namespace NHibernate.Exceptions
{
/// <summary>
/// Defines a contract for implementations that know how to convert a <see cref="System.Data.Common.DbException"/>
/// into NHibernate's <see cref="ADOException"/> hierarchy.
/// </summary>
/// <remarks>
/// Inspired by Spring's SQLExceptionTranslator.
///
/// Implementations <b>must</b> have a constructor which takes a
/// <see cref="IViolatedConstraintNameExtracter"/> parameter.
/// <para/>
/// Implementations may implement <see cref="IConfigurable"/> if they need to perform
/// configuration steps prior to first use.
/// </remarks>
/// <seealso cref="SQLExceptionConverterFactory"/>
public interface ISQLExceptionConverter
{
/// <summary>
/// Convert the given <see cref="System.Data.Common.DbException"/> into custom Exception.
/// </summary>
/// <param name="adoExceptionContextInfo">Available information during exception throw.</param>
/// <returns> The resulting Exception to throw. </returns>
Exception Convert(AdoExceptionContextInfo adoExceptionContextInfo);
}
}