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

Latest commit

 

History

History
59 lines (44 loc) · 2.11 KB

subscribeonerror.md

File metadata and controls

59 lines (44 loc) · 2.11 KB

Rx.Observable.prototype.subscribeOnError(onError, [thisArg])

Subscribes a function to invoke upon exceptional termination of the observable sequence.

Arguments

  1. onError (Function): Function to invoke upon exceptional termination of the observable sequence.
  2. [thisArg] (Any): Object to use as this when executing callback.

Returns

(Disposable): The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.

Example

/* Using functions */
var source = Rx.Observable.throw(new Error());

var subscription = source.subscribeOnError(
  function (err) {
    console.log('Error: %s', err);
  });

// => Error: Error

/* With a thisArg */
var source = Rx.Observable.throw(new Error());

var subscription = source.subscribeOnError(
  function (err) {
    this.log('Error: %s', err);
  }, console);

// => Error: Error

Location

File:

Dist:

NPM Packages:

NuGet Packages:

Unit Tests: