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
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue