UNPKG

@piggly/fastify-chassis

Version:

An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.

19 lines (18 loc) 693 B
import type { DefaultEnvironment } from '../types'; /** * Process uncaught error. * * It will wait for: * - EventBus cleanup; * - LoggerService flush and cleanup. * * You may not need to cleanup classes above when using this. * * @param {Environment} env * @param {() => Promise<number>} beforeExit * @param {number} exitCode Used when beforeExit is not provided. Default is 0. * @returns The callback function. * @since 5.1.0 * @author Caique Araujo <caique@piggly.com.br> */ export declare const processUncaught: <Environment extends DefaultEnvironment>(env: Environment, beforeExit?: () => Promise<number>, exitCode?: number) => (reason: any, origin: any) => Promise<never>;