From: Michael D. <mik...@us...> - 2004-11-30 18:36:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26812/NHibernate/Id Modified Files: SequenceGenerator.cs TableGenerator.cs Log Message: Modified how exceptions are rethrown - NH-153 and this blog http://dotnetguy.techieswithcats.com/archives/004118.shtml inspired effort. Index: TableGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/TableGenerator.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TableGenerator.cs 27 Nov 2004 01:00:09 -0000 1.10 --- TableGenerator.cs 30 Nov 2004 18:36:50 -0000 1.11 *************** *** 115,122 **** rs.Close(); } catch (Exception e) { log.Error("could not read a hi value", e); ! throw e; } finally --- 115,123 ---- rs.Close(); } + // TODO: change to SqlException catch (Exception e) { log.Error("could not read a hi value", e); ! throw; } finally *************** *** 135,142 **** rows = ups.ExecuteNonQuery(); } catch (Exception e) { log.Error("could not update hi value in: " + tableName, e); ! throw e; } finally --- 136,144 ---- rows = ups.ExecuteNonQuery(); } + // TODO: change to SqlException catch (Exception e) { log.Error("could not update hi value in: " + tableName, e); ! throw; } finally Index: SequenceGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/SequenceGenerator.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SequenceGenerator.cs 14 Sep 2004 17:49:54 -0000 1.5 --- SequenceGenerator.cs 30 Nov 2004 18:36:50 -0000 1.6 *************** *** 54,60 **** return result; } catch (Exception e) { ! throw e; } finally --- 54,62 ---- return result; } + // TODO: change to SQLException catch (Exception e) { ! // TODO: add code to log the sql exception ! throw; } finally |