throwError function

Observable<Never> throwError(
  1. Object error, {
  2. StackTrace? stackTrace,
  3. Scheduler? scheduler,
})

An Observable that emits no items and immediately throws an error.

Implementation

Observable<Never> throwError(Object error,
        {StackTrace? stackTrace, Scheduler? scheduler}) =>
    ThrowErrorObservable(error, stackTrace ?? StackTrace.current,
        scheduler ?? const ImmediateScheduler());