better error handling for api.weather.gov
This commit is contained in:
parent
9a09ccd1ea
commit
eb321005d9
12 changed files with 39 additions and 69 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue