In this post, I’m covering updates from v1.7.0 and v1.7.1.
Version 1.7.0 introduced new features and internal improvements, while 1.7.1 focuses on bug fixes, security hardening, and stability.
ds-express-errors v1.7.0 – January 5, 2026
Changes
Added express-validator support
Updated error mapping logic for Mongoose and Prisma
Added validation checks for setConfig
Refactored internal error handling logic
Fixed a logger-related bug
What this means
Version 1.7.0 improves validation support, provides more reliable database error mapping, and strengthens overall logging behavior.
ds-express-errors v1.7.1 – January 7, 2026
This patch release focuses on security, stability, and edge-case fixes discovered shortly after v1.7.0.
Security
- Fixed a log injection vulnerability in the internal logger
Fixes & Improvements
Improved validation checks for setConfig to prevent invalid configurations
Fixed a crash in custom mappers when returning Promises or async functions
Enhanced environment configuration checks for safer runtime detection
Added a missing fallback statusCode in defaultErrorAnswer to prevent unexpected 500 responses
Why you should upgrade
If you use custom mappers, custom configuration, or rely on internal logging, upgrading to v1.7.1 is strongly recommended for improved safety and reliability.
Upgrade Notes
Update to the latest version:
npm install ds-express-errors@latest
Additional notes:
express-validator: Make sure validators are properly registered in your routes to take full advantage of the new support.
Custom mappers / setConfig: Ensure your configuration and custom mappers follow the validation rules to avoid runtime errors.
Example usage:
const { setConfig, errorHandler } = require('ds-express-errors');
setConfig({
customLogger: logger,
customMappers: [
(err) => {
if (err.name === 'newError') {
return Errors.BadRequest();
}
}
],
devEnvironments: ['development', 'dev'],
formatError: (err, { req, isDev }) => ({
success: false,
error: {
code: err.statusCode,
message: err.message,
...(isDev ? { debug_stack: err.stack } : {})
}
})
});
const app = express();
// ... your routes ...
app.use(errorHandler);
More details:
Website & full changelog: changelog
Top comments (0)