Log errors when requests fail

This commit is contained in:
Matt Isenhower 2017-08-13 09:19:04 -07:00
parent 200e0f0a1f
commit 7a04c40411
2 changed files with 16 additions and 4 deletions

View File

@ -40,5 +40,8 @@ module.exports.update = function() {
fs.writeFile(`${dataPath}/salmonruncalendar.json`, JSON.stringify({ schedules }));
console.info('Updated Salmon Run calendar.');
}).catch(e => raven.captureException(e));
}).catch(e => {
raven.captureException(e);
console.error('Couldn\'t update Salmon Run calendar.');
});
}

View File

@ -22,7 +22,10 @@ const updateSchedules = function() {
fs.writeFile(`${dataPath}/schedules.json`, JSON.stringify(response.data));
console.info('Updated map schedules.');
}).catch(e => raven.captureException(e));
}).catch(e => {
raven.captureException(e);
console.error('Couldn\'t update map schedules.')
});
}
const updateTimeline = function() {
@ -39,7 +42,10 @@ const updateTimeline = function() {
fs.writeFile(`${dataPath}/timeline.json`, JSON.stringify(data));
console.info('Updated timeline.');
}).catch(e => raven.captureException(e));
}).catch(e => {
raven.captureException(e);
console.error('Couldn\'t update timeline.')
});
}
const updateFestivals = function() {
@ -51,7 +57,10 @@ const updateFestivals = function() {
fs.writeFile(`${dataPath}/festivals-na.json`, JSON.stringify(response.data));
console.info('Updated festivals.');
}).catch(e => raven.captureException(e));
}).catch(e => {
raven.captureException(e);
console.error('Couldn\'t update festivals.')
});
}
module.exports.update = function() {