mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Made exception handling of slice info plugin way more robust
CURA-1831
This commit is contained in:
parent
b3a6fafd97
commit
57d0ad1bd0
@ -45,6 +45,7 @@ class SliceInfo(Extension):
|
|||||||
Preferences.getInstance().setValue("info/asked_send_slice_info", True)
|
Preferences.getInstance().setValue("info/asked_send_slice_info", True)
|
||||||
|
|
||||||
def _onWriteStarted(self, output_device):
|
def _onWriteStarted(self, output_device):
|
||||||
|
try:
|
||||||
if not Preferences.getInstance().getValue("info/send_slice_info"):
|
if not Preferences.getInstance().getValue("info/send_slice_info"):
|
||||||
Logger.log("d", "'info/send_slice_info' is turned off.")
|
Logger.log("d", "'info/send_slice_info' is turned off.")
|
||||||
return # Do nothing, user does not want to send data
|
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)
|
Logger.log("i", "Sent anonymous slice info to %s", self.info_url)
|
||||||
f.close()
|
f.close()
|
||||||
except Exception as e:
|
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
|
Loading…
x
Reference in New Issue
Block a user