Author: igorz
Date: 2007-05-21 08:30:10 -0400 (Mon, 21 May 2007)
New Revision: 77759

Modified:
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/ChangeLog
   branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/DataSourceView.cs
Log:
merged r77739-77740

Modified: branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/ChangeLog 
2007-05-21 12:07:21 UTC (rev 77758)
+++ branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/ChangeLog 
2007-05-21 12:30:10 UTC (rev 77759)
@@ -1,3 +1,9 @@
+2007-05-21 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * DataSourceView.cs: refactoring: Update, Insert methods:
+       exception is re-thrown from catch scope. 
+       It allows actual call stack be shown    
+
 2007-05-17  Vladimir Krasnov  <[EMAIL PROTECTED]>
 
        * TemplateControl.jvm.cs: refactored key for CachedString method

Modified: 
branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/DataSourceView.cs
===================================================================
--- branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/DataSourceView.cs 
2007-05-21 12:07:21 UTC (rev 77758)
+++ branches/mainsoft/gh20/mcs/class/System.Web/System.Web.UI/DataSourceView.cs 
2007-05-21 12:30:10 UTC (rev 77759)
@@ -57,12 +57,12 @@
                        if (callBack == null)
                                throw new ArgumentNullException ("callBack");
 
-                       int rowAffected = 0;
+                       int rowAffected;
                        try {
                                rowAffected = ExecuteDelete (keys, values);
                        }
                        catch (Exception e) {
-                               if (!callBack (rowAffected, e))
+                               if (!callBack (0, e))
                                        throw;
                                return;
                        }
@@ -94,16 +94,16 @@
                        if (callBack == null)
                                throw new ArgumentNullException("callBack");
 
-                       int rowAffected = 0;
-                       Exception passOn = null;
+                       int rowAffected;
                        try {
                                rowAffected = ExecuteInsert (values);
                        } catch (Exception e) {
-                               passOn = e;
+                               if (!callBack (0, e))
+                                       throw;
+                               return;
                        }
 
-                       if (!callBack (rowAffected, passOn) && passOn != null)
-                               throw passOn;
+                       callBack (rowAffected, null);
                }
 
                protected virtual void OnDataSourceViewChanged (EventArgs 
eventArgs)
@@ -151,16 +151,16 @@
                        if (callBack == null)
                                throw new ArgumentNullException ("callBack");
 
-                       int rowAffected = 0;
-                       Exception passOn = null;
+                       int rowAffected;
                        try {
                                rowAffected = ExecuteUpdate (keys, values, 
oldValues);
                        } catch (Exception e) {
-                               passOn = e;
+                               if (!callBack (0, e))
+                                       throw;
+                               return;
                        }
 
-                       if (!callBack (rowAffected, passOn) && passOn != null)
-                               throw passOn;
+                       callBack (rowAffected, null);
                } 
                
                public virtual bool CanDelete { get { return false; } }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to