Rx.Observer.prototype.onError(error)
Notifies the observer that an exception has occurred.
参数
error
(Any): The error that has occurred.
Example
var observer = Rx.Observer.create(
x => console.log(`onNext: ${x}`),
e => console.log(`onError: ${e}`),
() => console.log('onCompleted'));
observer.onError(new Error('error!!'));
// => onError: Error: error!!