Action Messages & coroutines & Exceptions Handling.

Aug 10, 2010 at 10:55 AM

I am getting strange behavior if I throw exceptions inside my actions on purpose. (I am testing error handling of my appy)

How are we to handle exceptions that originate within an action "handler"?

It seems like the 1st exception I throw somehow ends up at Application.UnhandledException, but not the 2nd & 3rd... etc.

When I investigated what CM does, it catches exceptions and makes them disappear. How the 1st exception got through I have no clue.

Any idea how we are supposed to get to those exceptions?


Aug 10, 2010 at 3:07 PM
Would you be willing to email me a solution that demonstrates the issues? Thanks. robertheisenberg at hotmail dot com
Aug 10, 2010 at 6:46 PM

Here is where my search ended inside SequentialResult.cs:

         void ChildCompleted(object sender, ResultCompletionEventArgs args)
            if(args.Error != null || args.WasCancelled)
                OnComplete(args.Error, args.WasCancelled);

            var previous = sender as IResult;

            if(previous != null)
                previous.Completed -= ChildCompleted;

                    var next = enumerator.Current;
                    next.Completed += ChildCompleted;
                catch(Exception ex)
                    OnComplete(ex, false);
            else OnComplete(null, false);
That try catch block at the end is what I am talking about. I don't know how to get to those exceptions from outside CM.
Aug 10, 2010 at 7:09 PM
I added a ticket to improve this.
Aug 10, 2010 at 7:10 PM