
ds-express-errors
Centralized error management for Express.js
Details
- Follow on
- Categories
- Developer Tools
- Target Audience
- Backend DevelopersDevelopersOpen Source Maintainers
- Platforms
- Web
Discovery signals
How AI and people discover ds-express-errors on PeerPush
About ds-express-errors
ds-express-errors is an open source library for standardizing error handling in Express.js applications. It provides a centralized error handling middleware, ready to use HTTP error presets, automatic error mapping, customizable response formatting, logging, graceful shutdown utilities, and TypeScript support. The library includes HTTP error presets covering the most common 4xx and 5xx status codes. When these are not enough, the AppError base class allows creating custom application errors with any HTTP status code while remaining fully compatible with the error handler. Automatic error mapping converts errors from popular libraries into consistent HTTP responses. Supported integrations include Prisma, Sequelize, Mongoose, Zod, Joi, express-validator, JWT, and native JavaScript errors such as TypeError, ReferenceError, and SyntaxError. Production responses are sanitized while development responses preserve detailed debugging information. The library follows a zero runtime dependency philosophy. By default it recognizes supported errors using duck typing, eliminating the need to install additional packages. Projects that require stricter validation can enable instanceof checks by passing their own library classes through the errorClasses configuration. Every part of the behavior can be customized. You can define your own response format, replace or extend built in mappers, enable only selected mappers, configure development environments, integrate custom loggers such as Winston or Pino, or use the built in logger with rate limiting. The package also provides asyncHandler for asynchronous controllers, optional global handlers for uncaughtException and unhandledRejection, graceful HTTP shutdown helpers, configurable development and production behavior, and full TypeScript definitions. The goal of the library is to provide consistent, predictable, and maintainable error handling for Express.js applications while remaining lightweight, dependency free, and fully configurable.
Screenshots
Product Updates (2)
ds-express-errors — v1.9.x Update
A lot has changed since the last PeerPush update. - Added stricter and more accurate Prisma & Sequelize error detection - Added configurable "errorClasses" support for Prisma and Sequelize - Improved Sequelize connection error mapping - Improved production-safe error responses across Zod, Joi, express-validator, Mongoose, Prisma, Sequelize, and JWT - Added separate JWT error handling to prevent sensitive details from leaking in production - Improved TypeScript definitions and fixed several missing types - Fixed ESM imports and Prisma initialization error detection - Improved development logs and expanded test coverage - Updated documentation around configuration, "NODE_ENV", library errors, and mapper behaviour The current release is v1.9.2.
Comments (1)
https://youtu.be/b2ILzdZei3w?is=TrxUzUqzAXwIxRil There is also video introduction, which shows library core functions
ds-express-errors — v1.8.0 & v1.8.1 Release Notes
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.
Comments (1)
Reviews (0)
No reviews yet. Be the first to rate this product!









Comments (3)
Nice one!
Looks like a solid execution, nice launch!
Thanks!
great idea
Thank you!