UNPKG

mongoose-zod-error-formatter

Version:

A powerful error formatter utility for Mongoose and Zod validation errors, designed for Express.js applications. Simplify and unify your API error handling with structured, user-friendly error messages.

14 lines (13 loc) 318 B
import { Request } from "express"; interface ICustomError extends Error { statusCode?: number; } export declare const formatSimpleError: (req: Request, error: ICustomError) => { statusCode: number; message: string; errorMessages: { path: string; message: string; }[]; }; export {};