Describe the bug 馃悶
I鈥檝e described the problem in the test case below.
In summary, the Switch operator disrupts error propagation and suppresses exceptions.
In my case, these exceptions are not caught by RxApp.DefaultExceptionHandler either, causing the app to crash.
The operator's documentation does not mention this behavior, so I consider it a bug.
Step to reproduce
[Fact]
public void PropagatesErrors()
{
bool exceptionCaught = false;
List<List<int>> listOfLists = [[0, 1, 2]];
listOfLists.ToObservable()
.ToObservableChangeSet(int (int value) => value)
.Select(set =>
{
throw new Exception(); // Something bad happened here
return Observable.Return(set);
})
.Do(_ => { }, e => { }) // here the error handler is called
.Switch() // here the exception is swallowed
.Catch((Exception e) => // this code will never be executed
{
exceptionCaught = true;
return Observable.Empty<IChangeSet<int, int>>();
})
.Subscribe();
Assert.True(exceptionCaught);
}
Reproduction repository
https://github.com/dmalukov/DynamicDataSwitchRepro
Expected behavior
The error should be propagated and not swallowed.
Describe the bug 馃悶
I鈥檝e described the problem in the test case below.
In summary, the Switch operator disrupts error propagation and suppresses exceptions.
In my case, these exceptions are not caught by RxApp.DefaultExceptionHandler either, causing the app to crash.
The operator's documentation does not mention this behavior, so I consider it a bug.
Step to reproduce
Reproduction repository
https://github.com/dmalukov/DynamicDataSwitchRepro
Expected behavior
The error should be propagated and not swallowed.