Skip to content

Commit

Permalink
Return error if status is not OK
Browse files Browse the repository at this point in the history
  • Loading branch information
qistoph committed May 20, 2019
1 parent 416fdf4 commit 15d6c2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ module.exports = NodeHelper.create({
if (data.error_message) {
console.log("MMM-MyCommute: " + data.error_message);
prediction.error = true;
} else if (data.status !== "OK") {
console.log("MMM-MyCommute: " + data.status);
prediction.error = true;
} else {

var routeList = new Array();
for (var i = 0; i < data.routes.length; i++) {
var r = data.routes[i];
Expand Down

0 comments on commit 15d6c2a

Please sign in to comment.