mirror of https://github.com/grpc/grpc-node.git
Add JS error for missing callback to sever#tryShutdown
This commit is contained in:
parent
31b75d7f07
commit
843d063037
|
@ -312,6 +312,9 @@ NAN_METHOD(Server::TryShutdown) {
|
|||
if (!HasInstance(info.This())) {
|
||||
return Nan::ThrowTypeError("tryShutdown can only be called on a Server");
|
||||
}
|
||||
if (!info[0]->IsFunction()) {
|
||||
return Nan::ThrowError("tryShutdown's argument must be a callback");
|
||||
}
|
||||
Server *server = ObjectWrap::Unwrap<Server>(info.This());
|
||||
if (server->wrapped_server == NULL) {
|
||||
// Server is already shut down. Call callback immediately.
|
||||
|
|
Loading…
Reference in New Issue