UNPKG

@visulima/cerebro

Version:

A delightful toolkit for building cross-runtime CLIs for Node.js, Deno, and Bun.

22 lines (21 loc) 989 B
import type { RenderErrorOptions } from "@visulima/error"; import type { Plugin } from "../types/plugin.d.ts"; export type ErrorHandlerOptions = { /** Show detailed error information including stack traces and code frames (default: false) */ detailed?: boolean; /** Exit process after handling error (default: true) */ exitOnError?: boolean; /** Custom error formatter function */ formatter?: (error: Error) => string; /** Whether to log errors (default: true) */ logErrors?: boolean; /** Options for renderError from \@visulima/error (only used when detailed is true) */ renderOptions?: Partial<RenderErrorOptions>; }; /** * Create an error handler plugin for enhanced error reporting. * Uses \@visulima/error for beautiful error formatting with code frames and stack traces. * @param options Error handler configuration options * @returns Plugin instance */ export declare const errorHandlerPlugin: (options?: ErrorHandlerOptions) => Plugin;