views:

17

answers:

1

Hi!

I'm implementing IObserver.

Are there any conventions about throwing exceptions from IObserver?

Can OnNext or any other method of my implementation throw exceptions?

What should happen if exception is thrown in OnNext or OnCompleted - should I catch all exceptions and call this.OnError(ex)?

What will happen if OnError throws?

+1  A: 

From previous discussions about this in the Rx forums, the best practice is if OnNext throws, you just let it bubble up to be handled by the Subscribe method, if the user decides to handle it, they will do so.

Actually the answer is not so simple, but you can check out a thread related to your question, here:

More closely related is probably this thread: What if an exception is thrown by the observer in OnNext

Richard Hein