Skip to content

Commit

Permalink
Merge pull request #38 from Notastica/catch-error-geocoding
Browse files Browse the repository at this point in the history
handling errors in the GAPI
  • Loading branch information
Panthro committed Aug 30, 2016
2 parents 5fa8167 + 33518b3 commit 9d80f95
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/geocoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const defaults = {
addressConcatenateChar: ',',
destinationField: 'location',
serviceName: 'geocoding',
prefetch: 10,
prefetch: 1,
queryEs: false,
esHost: 'localhost:9200'
};
Expand Down Expand Up @@ -196,6 +196,11 @@ const geocoding = (options) => {
});
});
})
.catch((err) => {
logger.warn('There was an error getting the location, retuning the message untouched.');
logger.debug('Error:', err);
return message;
})
.then((finalMessage) => {
m.afterProcess(finalMessage);
});
Expand Down

0 comments on commit 9d80f95

Please sign in to comment.