Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Channel argument validation error messages #932

Merged
merged 1 commit into from Jul 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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