2.9.2 • Published 7 years ago

feathers-errors v2.9.2

Weekly downloads
6,794
License
MIT
Repository
github
Last release
7 years ago

feathers-errors

Greenkeeper badge

Build Status Code Climate Test Coverage Dependency Status Download Status Slack Status

Common error types for feathers apps

Getting Started

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

Documentation

Current Error Types:

  • BadRequest: 400
  • NotAuthenticated: 401
  • PaymentError: 402
  • Forbidden: 403
  • NotFound: 404
  • MethodNotAllowed: 405
  • NotAcceptable: 406
  • Timeout: 408
  • Conflict: 409
  • LengthRequired: 411
  • Unprocessable: 422
  • TooManyRequests: 429
  • GeneralError: 500
  • NotImplemented: 501
  • BadGateway: 502
  • Unavailable: 503

Pro Tip: Feathers service adapters (ie. mongodb, memory, etc.) already emit the appropriate errors for you. :-)

Usage:

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'} });

License

Copyright (c) 2016 Feathers Contributors

Licensed under the MIT license.

feathers-ynm-solr@everything-registry/sub-chunk-1655@hookcompany/feathers-swaggerfeathers-nedb-fuzzy-searchfeathers-nedb-puzzy-searchfeathers-objection-pr-10feathers-offline-logfeathers-offline-publicationfeathers-offline-realtimefeathers-restfeathers-rest-arachnefeathers-rest-clientfeathers-legacy-authentication-hooksfeathers-levelupfeathers-lg-multi-service-mongoosefeathers-lg-multi-service-mongoose-model-factoryfeathers-linvodbfeathers-live-queryfeathers-postmarkfeathers-pouchdbfeathers-mailgunfeathers-mongodb-revisionsfeathers-offline-realtime-immutablefeathers-offline-snapshotfeathers-mongoose-advancedfeathers-mongoose-relayfeathers-mongoose-with-analog-idfeathers-jpos-serverfeathers-adapter-testfeathers-apollo-serverfeathers-apple-pushfeathers-attribute-permissionsfeathers-authentication-oauth1feathers-authentication-oauth2feathers-authentication-openidfeathers-authentication-patch-wechatfeathers-authentication-popupsfeathers-authentication-popups-githubfeathers-authentication-publickeyfeathers-authentication-refreshtokenfeathers-authentication-signedfeathers-authentication-typescript-fixfeathers-authenticationfeathers-authentication-anonymousfeathers-authentication-clientfeathers-authentication-jwtfeathers-authentication-keystonefeathers-authentication-localfeathers-rethinkdb-jkr3feathers-rethinkdb-r3feathers-rethinkyfeathers-schemafeathers-sendgridfeathers-service-verify-resetfeathers-waterlinefeathers-waterline-aggregatefeathers-skypagerfeathers-socket-commonsfeathers-starter-react-redux-loginfeathers-starter-react-redux-login-rolesfeathers-swagger-forkfeathers-tcombfeathers-telegram-botfeathers-urbanairshipfeathers-validate-hookfethinkyfather-fear@infinitebrahmanuniverse/nolb-feafeathers-clientfeathers-couchdbfeathers-datastorefeathers-datastore-ajvfeathers-beefeathers-bookshelffeathers-bookshelf-servicefeathers-cachefeathers-chat-app-glebfeathers-elastic-loggerfeathers-express-cassandrafeathers-filemakerfeathers-filemaker-bmangusfeathers-hooks-common2feathers-hooks-disable-multi-item-createfeathers-hooks-extrafeathers-hooks-validatorfeathers-horizonfeathers-include-hookfeathers-google-pushfeathers-graphqlfeathers-hook-validation-jsonschemafeathers-fs@getty.io/feathers-knex@koehlerb/feathers-datastore@pradent/feathers-objection@pitch-me/pitch-me-common@quentin-sommer/feathers-datastorekeystone-apisflowz-error-handler@skinnyworm/sip4pcos-backendinsights-core
2.9.2

7 years ago

2.9.1

7 years ago

2.9.0

7 years ago

2.8.2

7 years ago

2.8.1

7 years ago

2.8.0

7 years ago

2.7.1

7 years ago

2.7.0

7 years ago

2.6.3

7 years ago

2.6.2

7 years ago

2.6.1

7 years ago

2.6.0

7 years ago

2.5.0

7 years ago

2.4.0

8 years ago

2.3.0

8 years ago

2.2.0

8 years ago

2.1.0

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago