diff --git a/src/scrapers/china.ts b/src/scrapers/china.ts index 7f1a446..17e96f9 100644 --- a/src/scrapers/china.ts +++ b/src/scrapers/china.ts @@ -37,12 +37,24 @@ export default async function china(): Promise { }, }); + console.log('Scraped', result.data.airList.length, 'for China'); + return Bluebird.map( result.data.airList, async (cityDataPoint): Promise => { - const location = await getLatLng( - geocoderExceptions[cityDataPoint.CITYNAME] ?? cityDataPoint.CITYNAME - ); + let location: App.City['location'] = { + lat: 0, + lng: 0, + }; + + try { + location = await getLatLng( + geocoderExceptions[cityDataPoint.CITYNAME] ?? cityDataPoint.CITYNAME + ); + } catch (e) { + console.error(e); + console.log('Using dummy location for', cityDataPoint.CITYNAME); + } return { name: cityDataPoint.CITYNAME,