Skip to content

Commit 10005f0

Browse files
committed
Fix error case handling
1 parent 80b7b7b commit 10005f0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

arduino-cloud.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199

200200
},
201201
oneditsave: function () {
202-
if ($("#node-config-input-clientid").val() !== "__PWRD__" && $("#node-config-input-clientsecret").val() !== "__PWRD__") {
202+
if ($("#node-config-input-clientid").val() !== "__PWRD__" || $("#node-config-input-clientsecret").val() !== "__PWRD__") {
203203
connectionManager[this.id] = {
204204
tmpClientid: $("#node-config-input-clientid").val(),
205205
tmpClientsecret: $("#node-config-input-clientsecret").val(),

arduino-cloud.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ module.exports = function (RED) {
7878
this.status({});
7979
} catch (err) {
8080
console.log(err);
81+
this.status({ fill: "red", shape: "dot", text: "Error setting value" });
8182
}
8283
});
8384
}
@@ -134,6 +135,7 @@ module.exports = function (RED) {
134135
}
135136
} catch (err) {
136137
console.log(err);
138+
this.status({ fill: "red", shape: "dot", text: "Error getting value" });
137139
}
138140
}
139141
}
@@ -184,6 +186,7 @@ module.exports = function (RED) {
184186
this.pollTimeoutPoll = setTimeout(() => { this.poll(connectionConfig, pollTime) }, pollTime * 1000);
185187
} catch (err) {
186188
console.log(err);
189+
this.status({ fill: "red", shape: "dot", text: "Error getting value" });
187190
}
188191
}
189192
}
@@ -222,6 +225,7 @@ module.exports = function (RED) {
222225
}
223226
} catch (err) {
224227
console.log(err);
228+
this.status({ fill: "red", shape: "dot", text: "Error getting value" });
225229
}
226230
}
227231
}

0 commit comments

Comments
 (0)