actionhero
Version:
The reusable, scalable, and quick node.js API server for stateless and stateful applications
29 lines (28 loc) • 1.19 kB
TypeScript
import { Initializer, Action } from "../index";
import { ExceptionReporter } from "../classes/exceptionReporter";
import { ParsedJob } from "node-resque";
import { ActionheroLogLevel } from "../modules/log";
export interface ExceptionHandlerAPI {
reporters: Array<ExceptionReporter>;
report: ExceptionsInitializer["report"];
initializer: ExceptionsInitializer["initializer"];
action: ExceptionsInitializer["action"];
task: ExceptionsInitializer["task"];
}
/**
* Handlers for when things go wrong.
*/
export declare class ExceptionsInitializer extends Initializer {
constructor();
report: (error: NodeJS.ErrnoException, type: string, name: string, objects?: any, severity?: ActionheroLogLevel) => void;
initializer: (error: NodeJS.ErrnoException, fullFilePath: string) => void;
action: (error: NodeJS.ErrnoException, { to, action, params, duration, response, }: {
to: string;
action: Action["name"];
params: string;
duration: number;
response: string;
}) => void;
task: (error: NodeJS.ErrnoException, queue: string, task: ParsedJob, workerId: string | number) => void;
initialize(): Promise<void>;
}