DS Express Errors (centralizing errors library) — v1.8.0 & v1.8.1 Release Notes
Published: (January 11, 2026 at 11:34 PM EST)
1 min read
Source: Dev.to
Source: Dev.to
v1.8.0 – January 11, 2026
New features
- Custom error classes – Provide your own error classes (e.g., Zod, Joi) via
setConfigfor stricter verification. - Selective mappers – Enable only the mappers you need through the configuration, reducing unnecessary checks.
- Rate‑limited logger – Added
maxLoggerRequests(default 100 requests per minute) to prevent logger overload. - Colourful logger output – Built‑in loggers now support colour for easier reading.
- New Prisma error codes – Added handling for
P2005,P2006,P2007,P2011,P2027. - Additional error type –
Errors.GatewayTimeout(message)is now available.
Mapper improvements
- Express‑validator – Fixed incorrect logic.
- Mongoose – Corrected status code handling and added a check for
BigIntin the internalsafeStringifymethod. - Sequelize – Fixed status code handling and updated mapping to include:
SequelizeOptimisticLockErrorSequelizeEmptyResultErrorSequelizeDatabaseErrorSequelizeConnectionErrorSequelizeTimeoutError
- Prisma – Expanded error handling and refined verification logic.
Logger refactor
- Added support for a custom logger.
- Fixed missing
apiimport forlogDebug.
Configuration highlights
// Example snippet for enabling selective mappers and rate limiting
dsExpressErrors.setConfig({
mappers: {
zod: true,
joi: true,
// disable others you don't need
},
maxLoggerRequests: 100, // max log entries per minute
// optional: provide your own error classes
errorClasses: {
ZodError: ZodError,
JoiError: Joi.ValidationError,
},
});