Rx.Notification.createOnError(exception)
Creates an object that represents an OnError notification to an observer.
参数
exception
(Any): The exception contained in the notification.
返回值
(Notification): The OnError notification containing the exception.
Example
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