From eca3bbb14bb9ead9f4957a0055323b3b3f325620 Mon Sep 17 00:00:00 2001 From: Logan B <3870583+thinkpoop@users.noreply.github.com> Date: Wed, 11 Jun 2025 16:36:37 -0500 Subject: [PATCH] [owmweather] handle error msg from parseWeather --- apps/owmweather/boot.js | 2 +- apps/owmweather/lib.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/owmweather/boot.js b/apps/owmweather/boot.js index a2a880fee..82e3a280a 100644 --- a/apps/owmweather/boot.js +++ b/apps/owmweather/boot.js @@ -10,7 +10,7 @@ return settings.refresh * 1000 * 60 + 1; // +1 <- leave some slack }; - let onCompleted = function (result) { + let onCompleted = function () { loading = false; settings.updated = Date.now(); require('Storage').writeJSON("owmweather.json", settings); diff --git a/apps/owmweather/lib.js b/apps/owmweather/lib.js index d3f3d798c..b4893d484 100644 --- a/apps/owmweather/lib.js +++ b/apps/owmweather/lib.js @@ -44,7 +44,11 @@ exports.pull = function(completionCallback, errorCallback) { if (Bangle.http){ Bangle.http(uri, {timeout:10000}).then(event => { let result = parseWeather(event.resp); - if (completionCallback) completionCallback(result); + if (result === undefined) { + if (completionCallback) completionCallback(); + } else { + if (errorCallback) errorCallback(result); + } }).catch((e)=>{ if (errorCallback) errorCallback(e); });