Fixed breaking bug and server now responds with print status

This commit is contained in:
plane000
2018-07-19 15:18:49 +01:00
parent 566c7fb0ad
commit d633cbe2f9
4 changed files with 31 additions and 20 deletions

View File

@@ -11,9 +11,13 @@ module.exports.getWeather = async function(mode, coords) {
res = await req.send();
} catch (e) { }
if (mode == 1) {
return res.body.currently.summary;
} else if (mode == 2) {
return res.body.hourly.summary;
try {
if (mode == 1) {
return res.body.currently.summary;
} else if (mode == 2) {
return res.body.hourly.summary;
}
} catch (e) {
return -1;
}
}