Skip to content
This repository has been archived by the owner on Jul 16, 2018. It is now read-only.

Commit

Permalink
Add error handling to geocode reverse lookup with mapquest.
Browse files Browse the repository at this point in the history
  • Loading branch information
humphd committed Sep 13, 2013
1 parent b888cdc commit 51fe570
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/events/controllers/events.js
Expand Up @@ -170,6 +170,10 @@ module.exports = function (init) {
latitude: event.latitude,
longitude: event.longitude
}, function (err, loc) {
if (err || !loc) {
console.error('[webmaker-events] Error doing reverse lookup for event location with MapQuest API: ' + err);
return;
}
event.updateAttributes({
city: loc.adminArea5,
country: loc.adminArea1
Expand Down

0 comments on commit 51fe570

Please sign in to comment.