Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@feathersjs/errors
Advanced tools
Common error types for feathers apps
Feathers errors come with feathers by default. So typically you don't need to install it at all.
In the event that you do need to install it:
npm install --save @feathersjs/errors
BadRequest
: 400NotAuthenticated
: 401PaymentError
: 402Forbidden
: 403NotFound
: 404MethodNotAllowed
: 405NotAcceptable
: 406Timeout
: 408Conflict
: 409LengthRequired
: 411Unprocessable
: 422TooManyRequests
: 429GeneralError
: 500NotImplemented
: 501BadGateway
: 502Unavailable
: 503Pro Tip: Feathers service adapters (ie. mongodb, memory, etc.) already emit the appropriate errors for you. :-)
import errors from '@feathersjs/errors';
// If you were to create an error yourself.
var notFound = new errors.NotFound('User does not exist');
// You can wrap existing errors
var existing = new errors.GeneralError(new Error('I exist'));
// You can also pass additional data
var data = new errors.BadRequest('Invalid email', {email: 'sergey@google.com'});
// You can also pass additional data
var dataWithoutMessage = new errors.BadRequest({email: 'sergey@google.com'});
// If you need to pass multiple errors
var validationErrors = new errors.BadRequest('Invalid Parameters', {errors: {email: 'Email already taken'} });
// You can also omit the error message and we'll put in a default one for you
var validationErrors = new errors.BadRequest({errors: {email: 'Invalid Email'} });
Copyright (c) 2017 Feathers Contributors
Licensed under the MIT license.
FAQs
Common error types for Feathers apps
The npm package @feathersjs/errors receives a total of 93,755 weekly downloads. As such, @feathersjs/errors popularity was classified as popular.
We found that @feathersjs/errors demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.