Skip to content

Commit

Permalink
chore(wording) Fix grammatical issues in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tronix117 committed Nov 16, 2017
1 parent c250d4c commit 94b7435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,9 @@ out of the box with EmberJS.

### errorStackInResponse
Along handleErrors, When true, this option will send the error stack if available within the error
reponse. It will be stored under the `source.stack` key.
response. It will be stored under the `source.stack` key.

**Be careful, this option should never be enabled in production environment. It can propagate some
sensitive datas.**
**Please be careful, this option should never be enabled in a production environment. Doing so can expose sensitive data.**

#### example
```js
Expand Down Expand Up @@ -440,9 +439,9 @@ module.exports = function (MyModel) {
```

## Custom Errors
Generic errors respond with a 500, but sometime you want to have a better control over the error that is returned to the client, taking advantages of fields provided by JSONApi.
Generic errors respond with a 500, but sometimes you want to have a better control over the error that is returned to the client, taking advantages of fields provided by JSONApi.

**It is recommanded to extend the base Error constructor, before throwing errors, ex: BadRequestError**
**It is recommended that you extend the base Error constructor before throwing errors. Eg. BadRequestError**

`meta` and `source` fields needs to be objects.

Expand Down
4 changes: 2 additions & 2 deletions lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ function JSONAPIErrorHandler (err, req, res, next) {
* @param {String} errorDetail error message for the user, human readable
* @param {String} errorCode internal system error code
* @param {String} errorName error title for the user, human readable
* @param {String} errorSource Some informations about the source of the issue
* @param {String} errorMeta Some custom metas informations to give to the error response
* @param {String} errorSource Some information about the source of the issue
* @param {String} errorMeta Some custom meta information to give to the error response
* @return {Object}
*/
function buildErrorResponse (
Expand Down

0 comments on commit 94b7435

Please sign in to comment.