From 9bb64a900eaedb601b4f3cdb505320d02a0fd62d Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 7 Nov 2022 11:35:09 +0100 Subject: [PATCH] Log status when facing an error When the Lineage weather API cannot provide us a weather log the status error. --- .../features/weather/worker/WeatherRequestWorker.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/apiOreo/java/foundation/e/blisslauncher/features/weather/worker/WeatherRequestWorker.java b/app/src/apiOreo/java/foundation/e/blisslauncher/features/weather/worker/WeatherRequestWorker.java index ce1724e48c..c24fe758e8 100644 --- a/app/src/apiOreo/java/foundation/e/blisslauncher/features/weather/worker/WeatherRequestWorker.java +++ b/app/src/apiOreo/java/foundation/e/blisslauncher/features/weather/worker/WeatherRequestWorker.java @@ -39,17 +39,18 @@ public abstract class WeatherRequestWorker extends Worker { protected static void requestWeatherUpdate(Context context, Location location) { Log.i(TAG, "Requesting weather info for location: " + location); LineageWeatherManager weatherManager = LineageWeatherManager.getInstance(context); - weatherManager.requestWeatherUpdate(location, (info, weatherInfo) -> notifyUi(context, weatherInfo)); + weatherManager.requestWeatherUpdate(location, (status, weatherInfo) -> notifyUi(context, weatherInfo, status)); } protected static void requestCustomWeatherUpdate(Context context, WeatherLocation location) { Log.i(TAG, "Requesting weather info for location: " + location); LineageWeatherManager weatherManager = LineageWeatherManager.getInstance(context); - weatherManager.requestWeatherUpdate(location, (info, weatherInfo) -> notifyUi(context, weatherInfo)); + weatherManager.requestWeatherUpdate(location, (status, weatherInfo) -> notifyUi(context, weatherInfo, status)); } - protected static void notifyUi(@NonNull Context context, @Nullable WeatherInfo weatherInfo) { + protected static void notifyUi(@NonNull Context context, @Nullable WeatherInfo weatherInfo, int status) { if (weatherInfo == null) { + Log.i(TAG, "WeatherInfo is null. Status reported: " + status); return; } -- GitLab