How can I mark the exception as Handled to keep it from bubbling up to the Application_UnhandledException handler in my Silverlight app?
IObservable<someobject> obs;
obs.Subscribe( onnext => { }, ex =>
{
//error! how can I mark it as handled?
System.Windows.MessageBox.Show( ex.Message );
} );
Update:
In my application it was a RIA Services call so perhaps MarkErrorAsHandled would have solved the issue. Unfortunately the error was fixed on the database side and I’m not set up to recreate it.
For most exceptions you should be fine with providing an OnError handler upon subscription.
However, some frameworks apply additional requirements to exception handling. For example, RIA Services require that
System.ServiceModel.DomainServices.Client.OperationBase.MarkErrorAsHandled()is called in a completion callback. If it’s not called, RIA services will throw exception once the callback finishes.