|
Bugzilla – Full Text Bug Listing |
| Summary: | Exceptions thrown in a method that is invoked via Control.Invoke are not propagated to the caller | ||
|---|---|---|---|
| Product: | [Mono] Mono: Class Libraries | Reporter: | Tom Spink <tspink> |
| Component: | Windows.Forms | Assignee: | Mono Bugs <mono-bugs> |
| Status: | RESOLVED FIXED | QA Contact: | Mono Bugs <mono-bugs> |
| Severity: | Minor | ||
| Priority: | P5 - None | CC: | calberto.cortez, robertj |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | |||
| Found By: | Development | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
A patch to introduce exception propagation to Control.Invoke
A better patch to introduce exception propagation to Control.Invoke |
||
|
Description
Tom Spink
2009-04-22 08:30:55 UTC
Post here the patch, and I will review it. Thanks! Created attachment 289405 [details]
A patch to introduce exception propagation to Control.Invoke
The first "throw ex;" in the patch must be a "throw;" 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!
Created attachment 311470 [details]
A better patch to introduce exception propagation to Control.Invoke
Okay, so I've updated the patch to introduce those changes - thanks for reviewing guys!
I applied your patch in rev 139853. Thanks! Carlos. |