diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-10-15 17:00:54 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-10-15 17:00:54 +0300 |
commit | 0583814dfa053b62ea51d642a0704cb74029ca94 (patch) | |
tree | 56c88a18b30ca9d942ac319579a15d84255007bf /cura/PrinterOutput | |
parent | f56e43874761b5d4eaa206604e2f4f3021b2450d (diff) |
Fix HttpNetworkManager not providing error parameter if there is no error
Contributes to issue CURA-8609.
Diffstat (limited to 'cura/PrinterOutput')
-rw-r--r-- | cura/PrinterOutput/UploadMaterialsJob.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cura/PrinterOutput/UploadMaterialsJob.py b/cura/PrinterOutput/UploadMaterialsJob.py index 0181a87c01..9ef05bd3d7 100644 --- a/cura/PrinterOutput/UploadMaterialsJob.py +++ b/cura/PrinterOutput/UploadMaterialsJob.py @@ -121,13 +121,12 @@ class UploadMaterialsJob(Job): scope = self._scope ) - def onUploadRequestCompleted(self, reply: "QNetworkReply", error: Optional["QNetworkReply.NetworkError"]) -> None: + def onUploadRequestCompleted(self, reply: "QNetworkReply") -> None: """ Triggered when we successfully requested to upload a material archive. We then need to start uploading the material archive to the URL that the request answered with. :param reply: The reply from the server to our request to upload an archive. - :param error: An error code (Qt enum) if the request failed. Failure is handled by `onError` though. """ response_data = HttpRequestManager.readJSON(reply) if response_data is None: @@ -161,12 +160,11 @@ class UploadMaterialsJob(Job): scope = self._scope ) - def onUploadCompleted(self, reply: "QNetworkReply", error: Optional["QNetworkReply.NetworkError"]) -> None: + def onUploadCompleted(self, reply: "QNetworkReply") -> None: """ When we've successfully uploaded the archive to the cloud, we need to notify the API to start syncing that archive to every printer. :param reply: The reply from the cloud storage when the upload succeeded. - :param error: An error message if the upload failed. Errors are handled by the `onError` function though. """ for container_stack in self._printer_metadata: cluster_id = container_stack["um_cloud_cluster_id"] @@ -180,7 +178,7 @@ class UploadMaterialsJob(Job): scope = self._scope ) - def onUploadConfirmed(self, printer_id: str, reply: "QNetworkReply", error: Optional["QNetworkReply.NetworkError"]) -> None: + def onUploadConfirmed(self, printer_id: str, reply: "QNetworkReply", error: Optional["QNetworkReply.NetworkError"] = None) -> None: """ Triggered when we've got a confirmation that the material is synced with the printer, or that syncing failed. |