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 setConfig for 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 typeErrors.GatewayTimeout(message) is now available.

Mapper improvements

  • Express‑validator – Fixed incorrect logic.
  • Mongoose – Corrected status code handling and added a check for BigInt in the internal safeStringify method.
  • Sequelize – Fixed status code handling and updated mapping to include:
    • SequelizeOptimisticLockError
    • SequelizeEmptyResultError
    • SequelizeDatabaseError
    • SequelizeConnectionError
    • SequelizeTimeoutError
  • Prisma – Expanded error handling and refined verification logic.

Logger refactor

  • Added support for a custom logger.
  • Fixed missing api import for logDebug.

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,
  },
});
Back to Blog

Related posts

Read more »

Hello, Newbie Here.

Hi! I'm falling back into the realm of S.T.E.M. I enjoy learning about energy systems, science, technology, engineering, and math as well. One of the projects I...