Skip to content

Commit

Permalink
Merge pull request #932 from clehene/patch-1
Browse files Browse the repository at this point in the history
Fix Channel argument validation error messages
  • Loading branch information
murgatroid99 committed Jul 8, 2019
2 parents a996ada + 69f9749 commit c94d143
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/grpc-native-core/ext/channel.cc
Expand Up @@ -207,15 +207,15 @@ 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
Utf8String host(info[0]);
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<ChannelCredentials>(
Nan::To<Object>(info[1]).ToLocalChecked());
Expand All @@ -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) {
Expand Down

0 comments on commit c94d143

Please sign in to comment.