Skip to content

handleCrash

handleCrash(error, origin, exit?, getContext?): void

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/utils/crashHandler.ts:123

The crash-handling body. Exported (rather than only closed over by the listeners) so it can be unit-tested directly with an injected exit and getContext, without registering real process listeners or killing the test runner.

unknown

the thrown value / rejection reason

string

'uncaughtException' | 'unhandledRejection'

(code) => void

terminator (default process.exit); injectable so tests capture the code

() => CrashContext

source of the snapshot context (default the module context)

void