better error handling for api.weather.gov

This commit is contained in:
Matt Walsh
2020-09-09 15:23:19 -05:00
parent 9a09ccd1ea
commit eb321005d9
12 changed files with 39 additions and 69 deletions

View File

@@ -50,6 +50,12 @@ class LatestObservations extends WeatherDisplay {
// cut down to the maximum of 7
this.data = actualConditions.slice(0,this.MaximumRegionalStations);
// test for at least one station
if (this.data.length < 1) {
this.setStatus(STATUS.noData);
return;
}
this.drawCanvas();
}