[owmweather] handle error msg from parseWeather

master
Logan B 2025-06-11 16:34:23 -05:00
parent 7cc837d595
commit c389727eaf
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,11 @@ exports.pull = function(completionCallback, errorCallback) {
if (Bangle.http){ if (Bangle.http){
Bangle.http(uri, {timeout:10000}).then(event => { Bangle.http(uri, {timeout:10000}).then(event => {
let result = parseWeather(event.resp); let result = parseWeather(event.resp);
if (completionCallback) completionCallback(result); if (result === undefined) {
if (completionCallback) completionCallback();
} else {
if (errorCallback) errorCallback(result);
}
}).catch((e)=>{ }).catch((e)=>{
if (errorCallback) errorCallback(e); if (errorCallback) errorCallback(e);
}); });