Created
September 19, 2016 03:22
-
-
Save dimotsai/6a0a7a61ce8e7e879b027bbd884e0a2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/get_reverse_geocode.js b/get_reverse_geocode.js | |
| index d334008..27a8e0c 100644 | |
| --- a/get_reverse_geocode.js | |
| +++ b/get_reverse_geocode.js | |
| @@ -9,7 +9,9 @@ module.exports = function(latitude, longitude, language = 'zh-TW') { | |
| latlng: `${latitude},${longitude}`, | |
| language: language | |
| }, function(err, body) { | |
| - if (body.status != 'OK') { | |
| + if (err) { | |
| + reject(err); | |
| + } else if (body.status != 'OK') { | |
| reject(body.error_message); | |
| } else { | |
| let components = []; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment