Преглед на файлове

Node xDS example: show error on failure, close client when done

Michael Lumish преди 4 години
родител
ревизия
c3cee0713a
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      examples/node/xds/greeter_client.js

+ 2 - 0
examples/node/xds/greeter_client.js

@@ -53,7 +53,9 @@ function main() {
     user = 'world';
   }
   client.sayHello({name: user}, function(err, response) {
+    if (err) throw err;
     console.log('Greeting:', response.message);
+    client.close();
   });
 }