I have two observables:
- Total process timeout (Observable 1)
- Current action timeout (Observable 2)
The second one makes use of the timeout extension method. The only thing I want to do is to throw my own exception instead of the default timeout exception.
var totalTimeout = Observable.Throw<FoobarException>(new FoobarException("my own text")).DelaySubscription(TimeSpan.FromSeconds(10));
var processStepTimeout = Observable.FromEventPattern(btn_nextStep, nameof(btn_nextStep.Click)).Timeout(TimeSpan.FromSeconds(3)); //my message
totalTimeout.Amb(processStepTimeout).Subscribe(ex => {}, ex => MessageBox.Show(ex.Message));