UNPKG

prisma-error-formatter

Version:

A flexible and customizable Prisma error formatter to simplify and unify error handling in Prisma Client applications.

24 lines (23 loc) 701 B
import { ExceptionFilter, ArgumentsHost } from "@nestjs/common"; export interface ErrorResponse { success: boolean; message: string; errorMessages: Array<{ path: string; message: string; }>; } export declare class GlobalExceptionFilter implements ExceptionFilter { private readonly logger; catch(exception: unknown, host: ArgumentsHost): void; private formatException; private formatHttpException; private formatPrismaException; private formatValidationException; private formatGenericError; private isPrismaError; private isValidationError; private getStatus; private getDefaultMessageForStatus; private logException; }