Note: I’m referring to the .NET 4 version of RX.
I’ve been using the ReplaySubject class of RX. I’m calling the OnError with an exception as the parameter.
I was expecting that it will notify all the OnError subscribers and will pass them the exception, instead it just throws the exception and after that the exception just go unhandled.
Code is very simple, you can have a look at the code on GitHub.
https://github.com/arielbh/CodeCommander/blob/master/CodeValue.CodeCommander/CommandBase.cs
Line 117 is the OnNext call.
Got any ideas? obviously I want the behavior I’m expecting to happen.
Thanks
Ariel
OK, I found out the cause of it.
If you are not subscribed to OnError, than the default behavior is throwing the exception.
I was not careful enough so the Subject that raises the error was no being observed.
More info:
http://social.msdn.microsoft.com/Forums/en/rx/thread/3125094b-1ab2-4d01-8f44-fb68ef913f43