That is likely to change (I think it has already been changed, for that matter). NH now throws Hibernate exception only
On Tue, Oct 21, 2008 at 4:12 PM, CassioT <[EMAIL PROTECTED]> wrote: > > Hi, > > I was reading an article - > > > http://today.java.net/pub/a/today/2006/04/06/exception-handling-antipatterns.html > > about exception handling and this paragraph took my attention: > > "Wrapping an exception can provide extra information to the user by > adding your own message (as in the example above), while still > preserving the stack trace and message of the original exception. It > also allows you to hide the implementation details of your code, which > is the most important reason to wrap exceptions. For instance, look at > the Hibernate API. Even though Hibernate makes extensive use of JDBC > in its implementation, and most of the operations that it performs can > throw SQLException, Hibernate does not expose SQLException anywhere in > its API. Instead, it wraps these exceptions inside of various > subclasses of HibernateException. Using the approach allows you to > change the underlying implementation of your module without modifying > its public API." > > I can catch MySql exceptions from nhibernate like this one: "Cannot > delete or update a parent row" (I know this is only the message but > the exception type is MySql.Data.MySqlClient.MySqlException) > > Is this intentional or it will be modified in the future? What do you > think about it? > > Thanks, > > Cassio Tavares > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
