Browse Source

move mapping functions out of try catch

fix-broken-scrape
Jørgen Sverre Lien Sellæg 5 years ago
parent
commit
9ac0c0ddba
  1. 7
      src/scrape.js

7
src/scrape.js

@ -18,13 +18,14 @@ const options = parse_args(process.argv.slice(2));
try { try {
events = await get_page_events(options); events = await get_page_events(options);
prev_events = await read_previous_events(options.events); prev_events = await read_previous_events(options.events);
} catch (e) {
console.error(e);
}
events = events events = events
.reduce(to_unique_events, prev_events) .reduce(to_unique_events, prev_events)
.map(event_date_to_date_obj) .map(event_date_to_date_obj)
.sort(by_date); .sort(by_date);
} catch (e) {
console.error(e);
}
if (options.output === null) { if (options.output === null) {
console.log(JSON.stringify(events)); console.log(JSON.stringify(events));

Loading…
Cancel
Save