Observable<T>.error constructor

Observable<T>.error(Object error)

Returns an observable sequence that emits an error, then immediately completes.

The error operator is one with very specific and limited behavior. It is mostly useful for testing purposes.

Example

new Observable.error(new ArgumentError());

Implementation

factory Observable.error(Object error) =>
    new Observable<T>(new ErrorStream<T>(error));