@eggjs/onerror
Version:
error handler for egg
11 lines (10 loc) • 471 B
TypeScript
import type { Context, EggCore } from '@eggjs/core';
import type { OnerrorError } from 'koa-onerror';
export declare function detectErrorMessage(ctx: Context, err: OnerrorError): string;
export declare function detectStatus(err: OnerrorError): number;
export declare function accepts(ctx: Context): "json" | "js" | "html";
export declare function isProd(app: EggCore): boolean;
/**
* Get the source directory name
*/
export declare function getSourceDirname(): string;