Skip to content

Commit

Permalink
Merge pull request #4 from ssowonny/error-documentation
Browse files Browse the repository at this point in the history
Add documentation for errors
  • Loading branch information
ssowonny authored Apr 11, 2017
2 parents dba661e + 711d0f9 commit 7b646f8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ params.require('contacts').permit('type', 'value').value()
// -> [{ type: 'e-mail', value: '[email protected]' }, { type: 'mobile', value: '+123987456' }]
```

### Errors

```js
// ParameterMissingError
try {
params.require('missingKey')
} catch(err) {
err instanceof ParameterMissingError // -> true
err instanceof Error // -> true
}
```

Look [Rails Strong Parameters specification](http://edgeguides.rubyonrails.org/action_controller_overview.html#strong-parameters) for more information.

## Contributing
Expand Down

0 comments on commit 7b646f8

Please sign in to comment.