Added logging when the post was aborted due to connection loss

CURA-2295
This commit is contained in:
Jaime van Kessel 2016-09-08 16:57:11 +02:00
parent 5e54e8570d
commit f75b4739f6

View file

@ -268,11 +268,13 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
# Some operating systems handle this themselves, others give weird issues.
try:
if self._post_reply:
self._post_reply.abort()
Logger.log("d", "Stopping post upload because the connection was lost.")
try:
self._post_reply.uploadProgress.disconnect(self._onUploadProgress)
except TypeError:
pass # The disconnection can fail on mac in some cases. Ignore that.
self._post_reply.abort()
self._progress_message.hide()
except RuntimeError:
self._post_reply = None # It can happen that the wrapped c++ object is already deleted.
@ -292,11 +294,13 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
# Some operating systems handle this themselves, others give weird issues.
try:
if self._post_reply:
self._post_reply.abort()
Logger.log("d", "Stopping post upload because the connection was lost.")
try:
self._post_reply.uploadProgress.disconnect(self._onUploadProgress)
except TypeError:
pass # The disconnection can fail on mac in some cases. Ignore that.
self._post_reply.abort()
self._progress_message.hide()
except RuntimeError:
self._post_reply = None # It can happen that the wrapped c++ object is already deleted.