function Failure.onIgnored
onIgnored(observer: IgnoredObserver | null): void

Installs a process-wide observer for every ignored failure — the interception seam for "list everything the program decided not to handle". Costs one null check on the failure path only (nothing on success, nothing per Task), and retains nothing itself: whether the suppressed failures accumulate, sample, or stream somewhere is the observer's decision. Pass null to detach.

This is the portable hook (it works in browsers) and it holds one observer. On Node and Deno the same events also publish to the IGNORED_CHANNEL_NAME diagnostics_channel, which takes any number of platform-level subscribers — prefer it for APM/tracing agents.

import * as Failure from './failure.ts';

const suppressed: { context: string; error: unknown }[] = [];
Failure.onIgnored((context, error) => suppressed.push({ context, error }));
// … exercise the program, then: console.table(suppressed)
Failure.onIgnored(null); // detach

Parameters

observer: IgnoredObserver | null

Return Type

void

Usage

import { Failure } from "lib/result/index.ts";
const { onIgnored } = Failure;