Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
feathers-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 feathers-errors
BadRequest
: 400NotAuthenticated
: 401PaymentError
: 402Forbidden
: 403NotFound
: 404MethodNotAllowed
: 405NotAcceptable
: 406Timeout
: 408Conflict
: 409Unprocessable
: 422GeneralError
: 500NotImplemented
: 501Unavailable
: 503Pro Tip: Feathers service adapters (ie. mongodb, memory, etc.) already emit the appropriate errors for you. :-)
import errors from 'feathers-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'} });
1.2.0
1.1.2
1.1.1
1.1.0
1.0.0
0.2.0
0.1.4
missing
to fourOhFour
0.1.3
0.1.2
0.1.1
var types = require('feathers-errors').types;
0.1.0
Copyright (c) 2015 Feathers Contributors
Licensed under the MIT license.
FAQs
Common error types for feathers apps
The npm package feathers-errors receives a total of 3,930 weekly downloads. As such, feathers-errors popularity was classified as popular.
We found that feathers-errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.