@webxsid/nest-exception
Version:
A centralized exception handling module for NestJS applications. It provides structured error management, logging, and automatic exception handling.
11 lines • 701 B
TypeScript
import { ArgumentsHost } from '@nestjs/common';
type ExceptionHandler<T extends Error> = (exception: T, host: ArgumentsHost) => void;
type ExceptionConstructor<T extends Error = Error> = abstract new (...args: any[]) => T;
export declare class ExceptionHandlerService {
private handlers;
register<T extends Error = Error>(exceptionType: ExceptionConstructor<T>, handler: ExceptionHandler<T>, priority?: number): void;
registerWhen<T extends Error>(canActivate: (exception: unknown) => boolean, handler: ExceptionHandler<T>, priority?: number): void;
getHandler(exception: unknown): ExceptionHandler<any> | undefined;
}
export {};
//# sourceMappingURL=exception-handler.service.d.ts.map