Skip to content

Commit

Permalink
Add descriptive error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed May 10, 2016
1 parent 005de55 commit b192895
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ module.exports = {
assert(count > 0)

if (typeof level !== 'undefined') {
assert([0, 1, 2].includes(level))
assert([0, 1, 2].includes(level), `invalid level ${level}`)

if (typeof type !== 'undefined')
assert(types.includes(type))
assert(types.includes(type), `invalid type ${type}`)

name = NAMES[level][type || 'any']

Expand Down

0 comments on commit b192895

Please sign in to comment.