[Mono-bugs] [Bug 497175] Exceptions thrown in a method that is invoked via Control.Invoke are not propagated to the caller

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Aug 7 23:56:05 EDT 2009


User calberto.cortez at gmail.com added comment

--- Comment #4 from Carlos Alberto Cortez <calberto.cortez at gmail.com>  2009-08-07 21:56:03 MDT ---
Besides to the comment by Robert, I think that in:

@@ -513,7 +525,14 @@

                        try {
                                AsyncMethodResult result = data.Result;
-                               object ret = data.Method.DynamicInvoke
+                               object ret;
+                               try {
+                                       ret = data.Method.DynamicInvoke
+                               } catch (Exception ex) {
+                                       result.CompleteWithException (ex);
+                                       return;
+                               }
                                result.Complete (ret);

We could move the AsyncMethodResult line out of the try block, so we can use a
catch block to call result.CompleteWithException, instead of having two try
blocks - which I don't like very much.

Besides that, the patch is fine. 


Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list