UNPKG

946 BTypeScriptView Raw
1import { Kernel } from '../index.js';
2/**
3 * The base exception handler that is used by default to exception
4 * ace exceptions.
5 *
6 * You can extend this class to custom the exception rendering
7 * behavior.
8 */
9export declare class ExceptionHandler {
10 debug: boolean;
11 /**
12 * Known error codes. For these error, only the error message is
13 * reported using the logger
14 */
15 protected knownErrorCodes: string[];
16 /**
17 * Internal set of known error codes.
18 */
19 protected internalKnownErrorCode: string[];
20 /**
21 * Logs error to stderr using logger
22 */
23 protected logError(error: {
24 message: any;
25 } & unknown, kernel: Kernel<any>): void;
26 /**
27 * Pretty prints uncaught error in debug mode
28 */
29 protected prettyPrintError(error: object): Promise<void>;
30 /**
31 * Renders an exception for the console
32 */
33 render(error: unknown, kernel: Kernel<any>): Promise<void>;
34}