aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2016-10-21 14:38:21 -0700
committerGravatar Sree Kuchibhotla <sreek@google.com>2016-10-21 14:38:21 -0700
commitc5fb957e50585575842b090c447f8cb685ad3ae9 (patch)
tree8d6affae63f99df546e588e7b49d4d4e0c5a7172 /examples
parentcb18d7a6b6e457c969cc5a9ef170c7b2a2014b86 (diff)
parent54b409c0da94732a510dfbe9aaf54dcceec06aad (diff)
Merge branch 'master' into rpc_mgr
Diffstat (limited to 'examples')
-rw-r--r--examples/node/dynamic_codegen/route_guide/route_guide_client.js7
-rw-r--r--examples/node/static_codegen/route_guide/route_guide_client.js7
2 files changed, 12 insertions, 2 deletions
diff --git a/examples/node/dynamic_codegen/route_guide/route_guide_client.js b/examples/node/dynamic_codegen/route_guide/route_guide_client.js
index 775b9addbf..b7550b201a 100644
--- a/examples/node/dynamic_codegen/route_guide/route_guide_client.js
+++ b/examples/node/dynamic_codegen/route_guide/route_guide_client.js
@@ -55,6 +55,7 @@ function runGetFeature(callback) {
function featureCallback(error, feature) {
if (error) {
callback(error);
+ return;
}
if (feature.name === '') {
console.log('Found no feature at ' +
@@ -117,13 +118,17 @@ function runRecordRoute(callback) {
string: 'db_path'
});
fs.readFile(path.resolve(argv.db_path), function(err, data) {
- if (err) callback(err);
+ if (err) {
+ callback(err);
+ return;
+ }
var feature_list = JSON.parse(data);
var num_points = 10;
var call = client.recordRoute(function(error, stats) {
if (error) {
callback(error);
+ return;
}
console.log('Finished trip with', stats.point_count, 'points');
console.log('Passed', stats.feature_count, 'features');
diff --git a/examples/node/static_codegen/route_guide/route_guide_client.js b/examples/node/static_codegen/route_guide/route_guide_client.js
index ecde78616b..e16de44a1a 100644
--- a/examples/node/static_codegen/route_guide/route_guide_client.js
+++ b/examples/node/static_codegen/route_guide/route_guide_client.js
@@ -56,6 +56,7 @@ function runGetFeature(callback) {
function featureCallback(error, feature) {
if (error) {
callback(error);
+ return;
}
var latitude = feature.getLocation().getLatitude();
var longitude = feature.getLocation().getLongitude();
@@ -115,7 +116,10 @@ function runRecordRoute(callback) {
string: 'db_path'
});
fs.readFile(path.resolve(argv.db_path), function(err, data) {
- if (err) callback(err);
+ if (err) {
+ callback(err);
+ return;
+ }
// Transform the loaded features to Feature objects
var feature_list = _.map(JSON.parse(data), function(value) {
var feature = new messages.Feature();
@@ -131,6 +135,7 @@ function runRecordRoute(callback) {
var call = client.recordRoute(function(error, stats) {
if (error) {
callback(error);
+ return;
}
console.log('Finished trip with', stats.getPointCount(), 'points');
console.log('Passed', stats.getFeatureCount(), 'features');