
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
express-response-errors
Advanced tools
Collection of custom response errors and middleware for express
Collection of custom response errors and middleware for Express.
npm i express-response-errors -S
Add middleware to your application bootstrap file:
const { responseErrorHandler } = require('express-response-errors');
app.use(responseErrorHandler);
Pass HttpError exception with required code and optional message to Express from route handler.
const { HttpError } = require('express-response-errors');
// Ex. with default status text
next(new HttpError(418));
// Ex. with custom message
next(new HttpError(418, 'I only brew tea'));
Pass a specific http exception with optional message to Express from route handler.
const { ImATeapotError } = require('express-response-errors');
// Ex. with default status text
next(new ImATeapotError());
// Ex. with custom status text
next(new ImATeapotError('I only brew tea'));
Errors passed to Express without a message defaults to HTTP standard status text.
Errors are handled by middleware which sends related error message and status as a HTTP response.
FAQs
Collection of custom response errors and middleware for express
We found that express-response-errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.