feat: weatherCachedData didn't throw exception on unknown city
This commit is contained in:
parent
4fc4374583
commit
79a3e1941a
@ -28,7 +28,7 @@ import eirb.pg203.weather.data.WeatherData.Condition;
|
|||||||
public class OpenWeatherMap extends WeatherCachedAPI {
|
public class OpenWeatherMap extends WeatherCachedAPI {
|
||||||
private static final String forecastBaseURL = "https://api.openweathermap.org/data/2.5/forecast";
|
private static final String forecastBaseURL = "https://api.openweathermap.org/data/2.5/forecast";
|
||||||
private String APIKey;
|
private String APIKey;
|
||||||
private static Clock clock = Clock.systemUTC();
|
public static Clock clock = Clock.systemUTC();
|
||||||
JSONFetcher JSONFetcher = new JSONFetcher();
|
JSONFetcher JSONFetcher = new JSONFetcher();
|
||||||
|
|
||||||
public OpenWeatherMap(String APIKey) {
|
public OpenWeatherMap(String APIKey) {
|
||||||
|
@ -39,9 +39,7 @@ public abstract class WeatherCachedAPI implements WeatherDataAPI {
|
|||||||
{
|
{
|
||||||
if (this.cache.needsUpdate(cityName, i))
|
if (this.cache.needsUpdate(cityName, i))
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
updateCache(days, cityName);
|
updateCache(days, cityName);
|
||||||
} catch(Exception e) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user