Skip to content

Commit 86de5a0

Browse files
author
Ruben Bridgewater
committed
Improve input validation error message
1 parent 6f24430 commit 86de5a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ function JavascriptRedisParser (options) {
248248
}
249249
for (var key in options) {
250250
if (typeof options[key] !== optionTypes[key]) {
251-
throw new TypeError('The options argument contains unkown properties or properties of a wrong type')
251+
throw new TypeError('The options argument contains the property "' + key + '" that is either unkown or of a wrong type')
252252
}
253253
}
254254
if (options.name === 'hiredis') {

test/parsers.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('parsers', function () {
4141
returnError: true
4242
})
4343
}, function (err) {
44-
assert.strictEqual(err.message, 'The options argument contains unkown properties or properties of a wrong type')
44+
assert.strictEqual(err.message, 'The options argument contains the property "returnError" that is either unkown or of a wrong type')
4545
assert(err instanceof TypeError)
4646
return true
4747
})
@@ -55,7 +55,7 @@ describe('parsers', function () {
5555
bla: undefined
5656
})
5757
}, function (err) {
58-
assert.strictEqual(err.message, 'The options argument contains unkown properties or properties of a wrong type')
58+
assert.strictEqual(err.message, 'The options argument contains the property "bla" that is either unkown or of a wrong type')
5959
assert(err instanceof TypeError)
6060
return true
6161
})

0 commit comments

Comments
 (0)