ds-express-errors — v1.9.x Update

by•

A lot has changed across the v1.9.x releases.

  • 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

  • Added missing "jwt" property for "needMappers"

  • Fixed "needMappers" being incorrectly typed as a single string union instead of an array

  • Updated "asyncHandler" to preserve Express generic request types

  • Additional README updates

In earlier v1.9.0—v1.9.2 patches, the "needMappers" TypeScript type had been incorrectly defined. Initially, it was simply an array, which meant TypeScript could not provide useful type hints. Following a discussion with a tester, it was changed to a union, but the type was defined incorrectly, causing the entire value to be treated as a single string instead of an array. This has now been fixed at v1.9.3.

The "asyncHandler.d.ts" definition has also been improved to preserve Express generic request types instead of losing type information when wrapping handlers.

More details can be found in the devlogs for version 1.9.3.

The current release is v1.9.3 — September 27

13 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.