mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-18 09:39:30 -07:00
better error handling for api.weather.gov
This commit is contained in:
@@ -115,6 +115,12 @@ class RegionalForecast extends WeatherDisplay {
|
||||
// filter out any false (unavailable data)
|
||||
const regionalData = regionalDataAll.filter(data => data);
|
||||
|
||||
// test for data present
|
||||
if (regionalData.length === 0) {
|
||||
this.setStatus(STATUS.noData);
|
||||
return;
|
||||
}
|
||||
|
||||
// return the weather data and offsets
|
||||
this.data = {
|
||||
regionalData,
|
||||
@@ -123,7 +129,6 @@ class RegionalForecast extends WeatherDisplay {
|
||||
};
|
||||
|
||||
this.setStatus(STATUS.loaded);
|
||||
this.drawCanvas();
|
||||
}
|
||||
|
||||
buildForecast (forecast, city, cityXY) {
|
||||
|
||||
Reference in New Issue
Block a user