-
Notifications
You must be signed in to change notification settings - Fork 933
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had seen those usages of ApplicationException and I was knowing this is an obsolete practice. But well, it does not really harm as far as I know, so I had not proposed to change that. I am for it.
Now I would rather not throw the base Exception
class instead on the cases where ApplicationException
was throw. (I am ok with deriving from it of course, this is just the throwing which I dislike.)
src/NHibernate/Logging.cs
Outdated
@@ -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 Exception("Public constructor was not found for " + loggerFactoryType, ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather throw an ArgumentException here (or InvalidOperationException). We should not throw the base Exception class.
src/NHibernate/Logging.cs
Outdated
} | ||
catch (InvalidCastException ex) | ||
{ | ||
throw new ApplicationException(loggerFactoryType + "Type does not implement " + typeof (ILoggerFactory), ex); | ||
throw new Exception(loggerFactoryType + "Type does not implement " + typeof (ILoggerFactory), ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous.
src/NHibernate/Logging.cs
Outdated
} | ||
catch (Exception ex) | ||
{ | ||
throw new ApplicationException("Unable to instantiate: " + loggerFactoryType, ex); | ||
throw new Exception("Unable to instantiate: " + loggerFactoryType, ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous.
Replaced bare |
No description provided.