Uh oh!
There was an error while loading. Please reload this page.
crypto: fix wrong error message - #33482
Conversation
When calling `crypto.sign()`, if the `key` parameter object is missing the `key` property, the error message is wrong. Before the fix: TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received an instance of Object Expected: TypeError [ERR_INVALID_ARG_TYPE]: The "key.key property" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received undefined Fixes: #33480 This seems like a copy&paste bug. Somebody copied from the end of the function, where this is correct, to here, where it's wrong.
(removed comment regarding failed test) |
Uh oh!
There was an error while loading. Please reload this page.
himself65
left a comment
There was a problem hiding this comment.
and unit tests need an update too
benbucksch
commented
May 20, 2020
I'm on it. |
benbucksch
commented
May 20, 2020
Review change done. Tests fixed. |
Uh oh!
There was an error while loading. Please reload this page.
Ready to merge. Seems like the tests pass. |
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM. Great work and good catch!
nodejs-github-bot
commented
May 23, 2020
BridgeAR
commented
May 23, 2020
@nodejs/crypto this could use another review. |
When calling `crypto.sign()`, if the `key` parameter object is missing the `key` property, the error message is wrong. Before the fix: TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received an instance of Object Expected: TypeError [ERR_INVALID_ARG_TYPE]: The "key.key property" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received undefined This seems like a copy&paste bug. Somebody copied from the end of the function, where this is correct, to here, where it's wrong. PR-URL: nodejs#33482Fixes: nodejs#33480 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
BridgeAR
commented
May 25, 2020
Landed in 2f00ca4 |
benbucksch
commented
May 26, 2020
Thanks! :) |
When calling `crypto.sign()`, if the `key` parameter object is missing the `key` property, the error message is wrong. Before the fix: TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received an instance of Object Expected: TypeError [ERR_INVALID_ARG_TYPE]: The "key.key property" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received undefined This seems like a copy&paste bug. Somebody copied from the end of the function, where this is correct, to here, where it's wrong. PR-URL: #33482Fixes: #33480 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
When calling `crypto.sign()`, if the `key` parameter object is missing the `key` property, the error message is wrong. Before the fix: TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received an instance of Object Expected: TypeError [ERR_INVALID_ARG_TYPE]: The "key.key property" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received undefined This seems like a copy&paste bug. Somebody copied from the end of the function, where this is correct, to here, where it's wrong. PR-URL: #33482Fixes: #33480 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
When calling `crypto.sign()`, if the `key` parameter object is missing the `key` property, the error message is wrong. Before the fix: TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received an instance of Object Expected: TypeError [ERR_INVALID_ARG_TYPE]: The "key.key property" argument must be of type string or an instance of Buffer, TypedArray, DataView, or KeyObject. Received undefined This seems like a copy&paste bug. Somebody copied from the end of the function, where this is correct, to here, where it's wrong. PR-URL: #33482Fixes: #33480 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
eezhi
commented
Oct 15, 2020
I get this error when i run 'knex migrate:latest" and I have no idea how to fix it. Been on it for days |
@eezhi : If you get this error message, you (or whoever wrote the code you run) are using the API wrong, specifically the type of one of your parameters is wrong. The API here is very confusing, because it accepts several different types for backward compat, so please read the docs very very carefully and slowly. I had severe trouble to understand it as well. If you still can't figure it out, post somewhere on a developer help forum. This ticket here is not the right place for getting help about your problem. |
eezhi
commented
Oct 16, 2020
Alright thanks |
When calling
crypto.sign(), if thekeyparameter object ismissing the
keyproperty, the error message is wrong.Before the fix:
TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of
type string or an instance of Buffer, TypedArray, DataView, or
KeyObject. Received an instance of Object
Expected:
TypeError [ERR_INVALID_ARG_TYPE]: The "key.key" property
must be of type string or an instance of Buffer, TypedArray,
DataView, or KeyObject. Received undefined
Fixes: #33480
This seems like a copy&paste bug. Somebody copied from the end of
the function, where this is correct, to here, where it's wrong.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes