From 69f97495ac19bb3b0f4274b309883735fd62ff20 Mon Sep 17 00:00:00 2001 From: Cosmin Lehene Date: Tue, 2 Jul 2019 14:39:49 -0700 Subject: [PATCH] Fix Channel argument validation error messages --- packages/grpc-native-core/ext/channel.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/grpc-native-core/ext/channel.cc b/packages/grpc-native-core/ext/channel.cc index 14293abd..fa7f8419 100644 --- a/packages/grpc-native-core/ext/channel.cc +++ b/packages/grpc-native-core/ext/channel.cc @@ -207,7 +207,7 @@ NAN_METHOD(Channel::New) { if (info.IsConstructCall()) { if (!info[0]->IsString()) { return Nan::ThrowTypeError( - "Channel expects a string, a credential and an object"); + "Channel's first argument (address) must be a string"); } grpc_channel *wrapped_channel; // Owned by the Channel object @@ -215,7 +215,7 @@ NAN_METHOD(Channel::New) { grpc_channel_credentials *creds; if (!ChannelCredentials::HasInstance(info[1])) { return Nan::ThrowTypeError( - "Channel's second argument must be a ChannelCredentials"); + "Channel's second argument (credentials) must be a ChannelCredentials"); } ChannelCredentials *creds_object = ObjectWrap::Unwrap( Nan::To(info[1]).ToLocalChecked()); @@ -224,7 +224,7 @@ NAN_METHOD(Channel::New) { if (!ParseChannelArgs(info[2], &channel_args_ptr)) { DeallocateChannelArgs(channel_args_ptr); return Nan::ThrowTypeError( - "Channel options must be an object with " + "Channel third argument (options) must be an object with " "string keys and integer or string values"); } if (creds == NULL) {