Sequence.throw()method

throw(reason?: unknown): Promise<IteratorResult<T, R | undefined>>

Throw an error into this iterator.

  • Mirrors the default async generator throw() behaviour.
  • Subclasses can override this to recover from errors or perform cleanup.