Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
express-response-errors
Advanced tools
Readme
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
The npm package express-response-errors receives a total of 297 weekly downloads. As such, express-response-errors popularity was classified as not popular.
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
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.