Skip to content

Latest commit

 

History

History
48 lines (29 loc) · 930 Bytes

createonerror.md

File metadata and controls

48 lines (29 loc) · 930 Bytes

Creates an object that represents an OnError notification to an observer.

Arguments

  1. exception (Any): The exception contained in the notification.

Returns

(Notification): The OnError notification containing the exception.

{% if book.isPdf %}

var source = Rx.Observable
    .fromArray([
        Rx.Notification.createOnError(new Error('woops'))
    ])
    .dematerialize();

var subscription = source.subscribe(
  x => console.log(`onNext: ${x}`),
  e => console.log(`onError: ${e}`),
  () => console.log('onCompleted'));

// => onError: Error: woops

{% else %}

Example

{% endif %}

{% if book.isPdf %}

{% else %}

Location

  • rx.js

{% endif %}