@@ -956,7 +956,8 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
956956 DH_get0_pqg (dh, &p, nullptr , nullptr );
957957 const int size = BN_num_bits (p);
958958 if (size < 1024 ) {
959- return env->ThrowError (" DH parameter is less than 1024 bits" );
959+ return THROW_ERR_INVALID_ARG_VALUE (
960+ env, " DH parameter is less than 1024 bits" );
960961 } else if (size < 2048 ) {
961962 args.GetReturnValue ().Set (FIXED_ONE_BYTE_STRING (
962963 env->isolate (), " DH parameter is less than 2048 bits" ));
@@ -1203,7 +1204,8 @@ void SecureContext::SetTicketKeys(const FunctionCallbackInfo<Value>& args) {
12031204 THROW_AND_RETURN_IF_NOT_BUFFER (env, args[0 ], " Ticket keys" );
12041205
12051206 if (Buffer::Length (args[0 ]) != 48 ) {
1206- return env->ThrowTypeError (" Ticket keys length must be 48 bytes" );
1207+ return THROW_ERR_INVALID_ARG_VALUE (
1208+ env, " Ticket keys length must be 48 bytes" );
12071209 }
12081210
12091211 memcpy (wrap->ticket_key_name_ , Buffer::Data (args[0 ]), 16 );
@@ -4391,7 +4393,8 @@ void ECDH::New(const FunctionCallbackInfo<Value>& args) {
43914393
43924394 int nid = OBJ_sn2nid (*curve);
43934395 if (nid == NID_undef)
4394- return env->ThrowTypeError (" First argument should be a valid curve name" );
4396+ return THROW_ERR_INVALID_ARG_VALUE (env,
4397+ " First argument should be a valid curve name" );
43954398
43964399 EC_KEY* key = EC_KEY_new_by_curve_name (nid);
43974400 if (key == nullptr )
0 commit comments