views:

282

answers:

1

In an MMVM application, how should exceptions be handled and bubbled?

If I get an exception in my model, during an Async callback, and throw an exception, this does not get bubbled to the ViewModel. I suspect that this is because the callback is not running on the UI thread.

What's the best practice for this?

Mark

+1  A: 

Best practice is to catch the exception in the async callback pass it back with an event. The WebClient events model it pretty well (where the caller will have to test for Error before they access the data).

Shawn Wildermuth
Great, that is what I am doing, gives me some reassurance that I'm currently doing things in the correct way :-)
Mark Cooper