moshen / node-googlemaps

A simple way to query the Google Maps API from Node.js
MIT License
560 stars 148 forks source link

Isolating JSON parsing exception in jsonParse #110

Closed evansiroky closed 8 years ago

evansiroky commented 8 years ago

In previous code, the entire callback along with JSON parsing was encapsulated with a try / catch block. Thus any error that occurs within the callback bubbles up to and is caught in this scope.

I added a unit test to specifically test for this in test\unit\utils\jsonParseTest.js called should call the callback only once if an error is thrown in callback execution.