Commit 8869db29 by Chavee Issariyapat

add try catch over publish

parent 4e81ef0e
...@@ -59,7 +59,12 @@ MQTTClient.prototype.resetbroker = function(topic, payload) { ...@@ -59,7 +59,12 @@ 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) {
this.client.publish(topic, payload); try {
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