Skip to content

NH-3988 - Replace ApplicationException with Exception #602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/NHibernate.Test/NHSpecificTest/NH1985/SampleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ public class SampleTest : BugTestCase
{
protected override void OnSetUp()
{
base.OnSetUp();

if (0 == ExecuteStatement("INSERT INTO DomainClass (Id, Label) VALUES (1, 'TEST record');"))
{
throw new ApplicationException("Insertion of test record failed.");
Assert.Fail("Insertion of test record failed.");
}
}

Expand All @@ -26,7 +24,7 @@ protected override void OnTearDown()
}

[Test]
[Ignore("It is valid to be delete immutable entities")]
[Ignore("It is valid to delete immutable entities")]
public void AttemptToDeleteImmutableObjectShouldThrow()
{
using (ISession session = OpenSession())
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/AssertionFailure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace NHibernate
/// Indicates failure of an assertion: a possible bug in NHibernate
/// </summary>
[Serializable]
public class AssertionFailure : ApplicationException
public class AssertionFailure : Exception
{
private const string DefaultMessage = "An AssertionFailure occurred - this may indicate a bug in NHibernate or in your custom types.";

Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/HibernateException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace NHibernate
/// Exceptions that occur in the database layer are left as native exceptions.
/// </remarks>
[Serializable]
public class HibernateException : ApplicationException
public class HibernateException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="HibernateException"/> class.
Expand Down
6 changes: 3 additions & 3 deletions src/NHibernate/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ private static ILoggerFactory GetLoggerFactory(string nhibernateLoggerClass)
}
catch (MissingMethodException ex)
{
throw new ApplicationException("Public constructor was not found for " + loggerFactoryType, ex);
throw new InstantiationException("Public constructor was not found for " + loggerFactoryType, ex, loggerFactoryType);
}
catch (InvalidCastException ex)
{
throw new ApplicationException(loggerFactoryType + "Type does not implement " + typeof (ILoggerFactory), ex);
throw new InstantiationException(loggerFactoryType + "Type does not implement " + typeof (ILoggerFactory), ex, loggerFactoryType);
}
catch (Exception ex)
{
throw new ApplicationException("Unable to instantiate: " + loggerFactoryType, ex);
throw new InstantiationException("Unable to instantiate: " + loggerFactoryType, ex, loggerFactoryType);
}
return loggerFactory;
}
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate/Util/TypeNameParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace NHibernate.Util
{
public class ParserException : ApplicationException
public class ParserException : Exception
{
public ParserException(string message) : base(message) { }
}
Expand Down