[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


http://bugzilla.novell.com/show_bug.cgi?id=497175

User calberto.cortez at gmail.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=497175#c4





--- 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
(data.Args);
+                               object ret;
+                               try {
+                                       ret = data.Method.DynamicInvoke
(data.Args);
+                               } 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. 

Thanks!

-- 
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