[owmweather] handle error msg from parseWeather
parent
7cc837d595
commit
c389727eaf
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue