Made exception handling of slice info plugin way more robust

CURA-1831
This commit is contained in:
Jaime van Kessel 2016-07-06 16:32:24 +02:00
parent b3a6fafd97
commit 57d0ad1bd0

View File

@ -45,6 +45,7 @@ class SliceInfo(Extension):
Preferences.getInstance().setValue("info/asked_send_slice_info", True)
def _onWriteStarted(self, output_device):
try:
if not Preferences.getInstance().getValue("info/send_slice_info"):
Logger.log("d", "'info/send_slice_info' is turned off.")
return # Do nothing, user does not want to send data
@ -115,4 +116,8 @@ class SliceInfo(Extension):
Logger.log("i", "Sent anonymous slice info to %s", self.info_url)
f.close()
except Exception as e:
Logger.logException("e", e)
Logger.logException("e", "An exception occurred while trying to send slice information")
except:
# We really can't afford to have a mistake here, as this would break the sending of g-code to a device
# (Either saving or directly to a printer). The functionality of the slice data is not *that* important.
pass