Continues an observable sequence that is terminated by an exception with the next observable sequence. There is an alias for this method catchException
for browsers <IE9
args
(Array
|arguments
): Observable sequences to catch exceptions for.
(Observable
): An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
var obs1 = Rx.Observable.throw(new Error('error'));
var obs2 = Rx.Observable.return(42);
var source = Rx.Observable.catch(obs1, obs2);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: 42
// => Completed
File:
Dist:
Prerequisites:
- None
NPM Packages:
NuGet Packages:
Unit Tests: