Skip to content

Commit c94d143

Browse files
authored
Merge pull request #932 from clehene/patch-1
Fix Channel argument validation error messages
2 parents a996ada + 69f9749 commit c94d143

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/grpc-native-core/ext/channel.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ NAN_METHOD(Channel::New) {
207207
if (info.IsConstructCall()) {
208208
if (!info[0]->IsString()) {
209209
return Nan::ThrowTypeError(
210-
"Channel expects a string, a credential and an object");
210+
"Channel's first argument (address) must be a string");
211211
}
212212
grpc_channel *wrapped_channel;
213213
// Owned by the Channel object
214214
Utf8String host(info[0]);
215215
grpc_channel_credentials *creds;
216216
if (!ChannelCredentials::HasInstance(info[1])) {
217217
return Nan::ThrowTypeError(
218-
"Channel's second argument must be a ChannelCredentials");
218+
"Channel's second argument (credentials) must be a ChannelCredentials");
219219
}
220220
ChannelCredentials *creds_object = ObjectWrap::Unwrap<ChannelCredentials>(
221221
Nan::To<Object>(info[1]).ToLocalChecked());
@@ -224,7 +224,7 @@ NAN_METHOD(Channel::New) {
224224
if (!ParseChannelArgs(info[2], &channel_args_ptr)) {
225225
DeallocateChannelArgs(channel_args_ptr);
226226
return Nan::ThrowTypeError(
227-
"Channel options must be an object with "
227+
"Channel third argument (options) must be an object with "
228228
"string keys and integer or string values");
229229
}
230230
if (creds == NULL) {

0 commit comments

Comments
 (0)