From: Michael D. <mik...@us...> - 2004-11-30 18:37:02
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26812/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: Modified how exceptions are rethrown - NH-153 and this blog http://dotnetguy.techieswithcats.com/archives/004118.shtml inspired effort. Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** SessionImpl.cs 29 Nov 2004 18:43:22 -0000 1.52 --- SessionImpl.cs 30 Nov 2004 18:36:50 -0000 1.53 *************** *** 1478,1482 **** //mainly a CallbackException RollbackDeletion(entry, delete); ! SessionImpl.Handle(e); //rethrow exception } } --- 1478,1491 ---- //mainly a CallbackException RollbackDeletion(entry, delete); ! if (e is HibernateException) ! { ! throw; ! } ! else ! { ! log.Error("unexpected exception", e); ! throw new HibernateException("unexpected exception", e); ! } ! } } *************** *** 3837,3854 **** #endregion - - public static void Handle(Exception e) - { - if (e is HibernateException) - { - throw (HibernateException) e; - } - else - { - log.Error("unexpected exception", e); - throw new HibernateException("unexpected exception", e); - } - } - public ICollection Filter(object collection, string filter) { --- 3846,3849 ---- |