ds-express-errors provides a single, predictable error-handling strategy for Express.js APIs, replacing scattered try/catch blocks and inconsistent responses.
It automatically maps errors from tools like Zod, Joi, express-validator, Prisma, Mongoose, Sequelize, and JWT into proper HTTP errors with consistent JSON output.
Everything is fully configurable — response shape, logging, environments, and custom error mapping.
Built for production with async handling, process-level guards, graceful shutdowns, and full TypeScript support
Added support for user-provided error classes in custom mappers (Zod, Joi).
Added the ability to enable only selected mappers via configuration, reducing unnecessary checks.
Added rate limiting for the logger.
Fixed incorrect logic in the express-validator mapper.
Expanded supported Prisma errors: P2005, P2006, P2007, P2011, P2027.
Improved validation logic for mongoose and sequelize mappers.
Version 1.8.1 — January 12, 2026
Fixed missing API import for logDebug.
Added maxLoggerRequests configuration option to limit the maximum number of log requests per minute (default is 100).
Added BigInt handling to the internal safeStringify method.
Fixed incorrect HTTP status codes in mongoose and sequelize mappers.
Refactored logger logic for customLogger.
Added Errors.GatewayTimeout(message).
Fixed Sequelize mapping for the following errors: SequelizeOptimisticLockError,
SequelizeEmptyResultError,
SequelizeDatabaseError,
SequelizeConnectionError,
SequelizeTimeoutError.
Product had at the time: 2 upvotes • 0 comments • 2 followers • 1 PeerPush
Comments (0)
No comments yet. Be the first to share your thoughts!
Comments (2)
Looks like a solid execution, nice launch!
Thanks!
great idea
Thank you!