Commit 8869db29 by Chavee Issariyapat

add try catch over publish

parent 4e81ef0e
...@@ -59,8 +59,13 @@ MQTTClient.prototype.resetbroker = function(topic, payload) { ...@@ -59,8 +59,13 @@ MQTTClient.prototype.resetbroker = function(topic, payload) {
MQTTClient.prototype.publish = function(topic, payload) { MQTTClient.prototype.publish = function(topic, payload) {
if (this.client && this.client.connected) { if (this.client && this.client.connected) {
try {
this.client.publish(topic, payload); this.client.publish(topic, payload);
} }
catch(e) {
}
}
else { else {
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment