Skip to content
Prev Previous commit
Next Next commit
fixup! src: throw ERR_INVALID_ARG_TYPE in C++ argument checks
  • Loading branch information
joyeecheung committed Apr 18, 2018
commit 834764ec6f3fafce90461d218955a9d0223de24f
6 changes: 3 additions & 3 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ void SecureContext::SetOptions(const FunctionCallbackInfo<Value>& args) {
ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());

if (args.Length() != 1 || !args[0]->IntegerValue()) {
return node::THROW_ERR_INVALID_ARG_TYPE(
return THROW_ERR_INVALID_ARG_TYPE(
sc->env(), "Options must be an integer value");
}

Expand Down Expand Up @@ -1033,7 +1033,7 @@ void SecureContext::SetSessionTimeout(const FunctionCallbackInfo<Value>& args) {
ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());

if (args.Length() != 1 || !args[0]->IsInt32()) {
return node::THROW_ERR_INVALID_ARG_TYPE(
return THROW_ERR_INVALID_ARG_TYPE(
sc->env(), "Session timeout must be a 32-bit integer");
}

Expand Down Expand Up @@ -4311,7 +4311,7 @@ void DiffieHellman::SetKey(const v8::FunctionCallbackInfo<v8::Value>& args,

if (!Buffer::HasInstance(args[0])) {
snprintf(errmsg, sizeof(errmsg), "%s must be a buffer", what);
return node::THROW_ERR_INVALID_ARG_TYPE(env, errmsg);
return THROW_ERR_INVALID_ARG_TYPE(env, errmsg);
}

BIGNUM* num =
Expand Down