Skip to content

Commit 9f95efc

Browse files
hazzikfredericDelaporte
authored andcommitted
NH-3988 - Replace ApplicationException with Exception
1 parent 9883271 commit 9f95efc

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/NHibernate.Test/NHSpecificTest/NH1985/SampleTest.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ public class SampleTest : BugTestCase
1010
{
1111
protected override void OnSetUp()
1212
{
13-
base.OnSetUp();
14-
1513
if (0 == ExecuteStatement("INSERT INTO DomainClass (Id, Label) VALUES (1, 'TEST record');"))
1614
{
17-
throw new ApplicationException("Insertion of test record failed.");
15+
Assert.Fail("Insertion of test record failed.");
1816
}
1917
}
2018

@@ -26,7 +24,7 @@ protected override void OnTearDown()
2624
}
2725

2826
[Test]
29-
[Ignore("It is valid to be delete immutable entities")]
27+
[Ignore("It is valid to delete immutable entities")]
3028
public void AttemptToDeleteImmutableObjectShouldThrow()
3129
{
3230
using (ISession session = OpenSession())

src/NHibernate/AssertionFailure.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace NHibernate
88
/// Indicates failure of an assertion: a possible bug in NHibernate
99
/// </summary>
1010
[Serializable]
11-
public class AssertionFailure : ApplicationException
11+
public class AssertionFailure : Exception
1212
{
1313
private const string DefaultMessage = "An AssertionFailure occurred - this may indicate a bug in NHibernate or in your custom types.";
1414

src/NHibernate/HibernateException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace NHibernate
1010
/// Exceptions that occur in the database layer are left as native exceptions.
1111
/// </remarks>
1212
[Serializable]
13-
public class HibernateException : ApplicationException
13+
public class HibernateException : Exception
1414
{
1515
/// <summary>
1616
/// Initializes a new instance of the <see cref="HibernateException"/> class.

src/NHibernate/Logging.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ private static ILoggerFactory GetLoggerFactory(string nhibernateLoggerClass)
6363
}
6464
catch (MissingMethodException ex)
6565
{
66-
throw new ApplicationException("Public constructor was not found for " + loggerFactoryType, ex);
66+
throw new InstantiationException("Public constructor was not found for " + loggerFactoryType, ex, loggerFactoryType);
6767
}
6868
catch (InvalidCastException ex)
6969
{
70-
throw new ApplicationException(loggerFactoryType + "Type does not implement " + typeof (ILoggerFactory), ex);
70+
throw new InstantiationException(loggerFactoryType + "Type does not implement " + typeof (ILoggerFactory), ex, loggerFactoryType);
7171
}
7272
catch (Exception ex)
7373
{
74-
throw new ApplicationException("Unable to instantiate: " + loggerFactoryType, ex);
74+
throw new InstantiationException("Unable to instantiate: " + loggerFactoryType, ex, loggerFactoryType);
7575
}
7676
return loggerFactory;
7777
}

src/NHibernate/Util/TypeNameParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace NHibernate.Util
88
{
9-
public class ParserException : ApplicationException
9+
public class ParserException : Exception
1010
{
1111
public ParserException(string message) : base(message) { }
1212
}

0 commit comments

Comments
 (0)