Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Latest commit

 

History

History
60 lines (46 loc) · 2.07 KB

catch.md

File metadata and controls

60 lines (46 loc) · 2.07 KB

Rx.Observable.catch(...args)

Continues an observable sequence that is terminated by an exception with the next observable sequence.

Arguments

  1. args (Array | arguments): Observable sequences to catch exceptions for.

Returns

(Observable): An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.

Example

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: %s', x);
  },
  function (err) {
    console.log('Error: %s', err);
  },
  function () {
    console.log('Completed');
  });

// => Next: 42
// => Completed

Location

File:

Dist:

Prerequisites:

  • None

NPM Packages:

NuGet Packages:

Unit Tests: