Skip to content

handleUnhandledError

function handleUnhandledError(error, behavior?): void;

Handle an error that was emitted through the special "error" event without any listener.

Node.js throws an ERR_UNHANDLED_ERROR in that situation, which crashes the whole process. DisTube handles it gracefully instead.

Error

The error

UnhandledErrorBehavior = "log"

The behavior to apply. Defaults to "log".

void

Nothing

The given error when the behavior is "throw"