method ILifecycleApi.onError
ILifecycleApi.onError(fn: (
error: Error,
) => void | Promise<void>
): void

Runs when an error escapes middleware or a handler.

Parameters

fn: (
error: Error,
) => void | Promise<void>

Hook body receiving the error and request context

Return Type

void

Usage

import { type ILifecycleApi } from "common/src/index.ts";