method Stream.errors
Stream.errors(): AsyncIterable<E>

Returns an async iterable of all errors collected during the stream processing. If any successful values were emitted during the stream processing, they will be ignored in this iterable.

Examples

Example 1

import { Stream } from "anabranch";

const stream = Source.from<number, string>(async function* () {
  yield 1;
  yield 2;
});

for await (const error of stream.errors()) {
  console.error("Error:", error);
}

Return Type

AsyncIterable<E>

Usage

import { type Stream } from ".";