Skip to content
Interfacetypesv0.14.4

ErrorsConfig

Settings for how the framework renders errors and reports faults.

interface ErrorsConfig

catchProcessErrors

Whether the framework reports a throw that escapes every handler, such as a promise your code never awaited or a setTimeout callback that threw. Both report as an unknown fault. The bot keeps running after an unhandled rejection. An uncaught exception runs the coordinated shutdown and exits 1.

Turn it off when the surrounding application registers its own unhandledRejection and uncaughtException handlers.

catchProcessErrors?: boolean

Default:true

defaultError

Class the framework constructs to render an unknown, non-denial fault. It receives the fault's tracking uuid.

defaultError?: new (uuid: UUID) => RenderableNotice

Default:the framework's generic error notice, which renders a generic "An unknown error occurred" message to the user

errorStack

Whether to show the error stack trace in the terminal for an unknown fault.

errorStack?: boolean

Default:false

ignoreApiCodes

discord.js API error codes the interaction error path swallows quietly, reporting no fault, for a code thrown by the handler's own work. When empty, every such code reports and a real bug (a double ack from a misplaced defer) surfaces. Add a code here to swallow it once you have confirmed it is an expected dead end in your bot. A swallowed code still debug-logs.

The reply sender always swallows the harmless reply-token codes on its own send for safety, independent of this list. The error path never crashes.

ignoreApiCodes?: readonly (number | string)[]

Default:[]

ignoreEventApiCodes

discord.js API error codes the event error path swallows quietly, reporting no fault. Discord delivers dead resources on events (a reaction on a deleted message, a member that just left), so a handler's own fetch can throw a gone-resource error.

When empty, a dead resource reports (throttled to one per minute per handler) until you confirm it is an expected dead end and add the code here, for example Unknown Message (10008), Unknown Member (10007), Unknown User (10013). A swallowed code still debug-logs.

ignoreEventApiCodes?: readonly (number | string)[]

Default:[]

logSilences

Whether a Silence debug-logs its reason. A per-event silence (a message from a bot) emits this line once per event, so turn it off to quiet a busy stream.

logSilences?: boolean

Default:true