effect-io-ai

Package: effect
Module: ErrorReporter

ErrorReporter.report

Runs all registered error reporters on the current fiber for a Cause.

When to use

Use to report a failure for observability without failing the current fiber.

Example (Reporting a cause manually)

import { Cause, Effect, ErrorReporter } from "effect"

// Log the cause for monitoring, then continue with a fallback
const program = Effect.gen(function*() {
  const cause = Cause.fail("something went wrong")
  yield* ErrorReporter.report(cause)
  return "fallback value"
})

Signature

declare const report: <E>(cause: Cause.Cause<E>) => Effect.Effect<void>

Source

Since v4.0.0