UNPKG

@eggjs/onerror

Version:
11 lines (10 loc) 471 B
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;