wrap it in a try catch

Hopefully when something in my plugin breaks (that's when, not if) it won't take down all of octoprint's UI.
This commit is contained in:
ntoff 2017-11-06 17:23:25 +10:00
parent 56f73ad6ab
commit 99364df94e

View File

@ -22,6 +22,7 @@ $(function() {
sendFanSpeed = function () {
self.control.sendCustomCommand({ command: "M106 S" + self.fanPWM() });
};
try {
//extra classes
$("#control > div.jog-panel").eq(0).addClass("controls");
$("#control > div.jog-panel").eq(1).addClass("tools");
@ -52,6 +53,10 @@ $(function() {
</div>\
");
}
}
catch(error) {
console.log(error);
}
//retrieve settings
self.onBeforeBinding = function() {
fanSpeed(self.settings.settings.plugins.fanspeedslider.defaultFanSpeed());