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:
parent
56f73ad6ab
commit
99364df94e
@ -22,6 +22,7 @@ $(function() {
|
|||||||
sendFanSpeed = function () {
|
sendFanSpeed = function () {
|
||||||
self.control.sendCustomCommand({ command: "M106 S" + self.fanPWM() });
|
self.control.sendCustomCommand({ command: "M106 S" + self.fanPWM() });
|
||||||
};
|
};
|
||||||
|
try {
|
||||||
//extra classes
|
//extra classes
|
||||||
$("#control > div.jog-panel").eq(0).addClass("controls");
|
$("#control > div.jog-panel").eq(0).addClass("controls");
|
||||||
$("#control > div.jog-panel").eq(1).addClass("tools");
|
$("#control > div.jog-panel").eq(1).addClass("tools");
|
||||||
@ -52,6 +53,10 @@ $(function() {
|
|||||||
</div>\
|
</div>\
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
//retrieve settings
|
//retrieve settings
|
||||||
self.onBeforeBinding = function() {
|
self.onBeforeBinding = function() {
|
||||||
fanSpeed(self.settings.settings.plugins.fanspeedslider.defaultFanSpeed());
|
fanSpeed(self.settings.settings.plugins.fanspeedslider.defaultFanSpeed());
|
||||||
|
Loading…
Reference in New Issue
Block a user