@feathersjs/errors
Advanced tools
Comparing version 4.3.0-pre.2 to 4.3.0-pre.3
@@ -6,2 +6,10 @@ # Change Log | ||
# [4.3.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.2...v4.3.0-pre.3) (2019-08-19) | ||
**Note:** Version bump only for package @feathersjs/errors | ||
# [4.3.0-pre.2](https://github.com/feathersjs/feathers/compare/v4.3.0-pre.1...v4.3.0-pre.2) (2019-08-02) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@feathersjs/errors", | ||
"description": "Common error types for Feathers apps", | ||
"version": "4.3.0-pre.2", | ||
"version": "4.3.0-pre.3", | ||
"homepage": "https://feathersjs.com", | ||
@@ -42,10 +42,10 @@ "main": "lib/index", | ||
"devDependencies": { | ||
"@feathersjs/feathers": "^4.3.0-pre.2", | ||
"@feathersjs/feathers": "^4.3.0-pre.3", | ||
"chai": "^4.2.0", | ||
"express": "^4.17.1", | ||
"mocha": "^6.1.4", | ||
"sinon": "^7.3.2", | ||
"mocha": "^6.2.0", | ||
"sinon": "^7.4.1", | ||
"sinon-chai": "^3.3.0" | ||
}, | ||
"gitHead": "4d350e5299315df3090a2231ef3caaf795dee994" | ||
"gitHead": "9f4498e455d81e91acc1ffd3ced4d36ba06f8466" | ||
} |
# @feathersjs/errors | ||
[![Build Status](https://travis-ci.org/feathersjs/feathers.png?branch=master)](https://travis-ci.org/feathersjs/feathers) | ||
[![Build Status](https://travis-ci.org/feathersjs/feathers.svg?branch=master)](https://travis-ci.org/feathersjs/feathers) | ||
[![Dependency Status](https://img.shields.io/david/feathersjs/feathers.svg?style=flat-square&path=packages/errors)](https://david-dm.org/feathersjs/feathers?path=packages/errors) | ||
@@ -15,44 +15,10 @@ [![Download Status](https://img.shields.io/npm/dm/@feathersjs/errors.svg?style=flat-square)](https://www.npmjs.com/package/@feathersjs/errors) | ||
Quick usage: | ||
```js | ||
const errors = require('@feathersjs/errors'); | ||
// If you were to create an error yourself. | ||
const notFound = new errors.NotFound('User does not exist'); | ||
// You can wrap existing errors | ||
const existing = new errors.GeneralError(new Error('I exist')); | ||
// You can also pass additional data | ||
const data = new errors.BadRequest('Invalid email', { | ||
email: 'sergey@google.com' | ||
}); | ||
// You can also pass additional data without a message | ||
const dataWithoutMessage = new errors.BadRequest({ | ||
email: 'sergey@google.com' | ||
}); | ||
// If you need to pass multiple errors | ||
const 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 | ||
const validationErrors = new errors.BadRequest({ | ||
errors: { | ||
email: 'Invalid Email' | ||
} | ||
}); | ||
``` | ||
## Documentation | ||
Please refer to the [@feathersjs/errors API documentation](https://docs.feathersjs.com/api/errors.html) for more details. | ||
Refer to the [Feathers errors API documentation](https://docs.feathersjs.com/api/errors.html) for more details. | ||
## License | ||
Copyright (c) 2018 Feathers Contributors | ||
Copyright (c) 2019 [Feathers contributors](https://github.com/feathersjs/client/graphs/contributors) | ||
Licensed under the [MIT license](LICENSE). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37973
24