diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-10-12 12:30:12 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-10-12 12:30:12 +0300 |
commit | 125c80430b1231901ca7bb8105235fc9676a5d4b (patch) | |
tree | c6c49803562aca601239f835f357b54691034fed /cura/PrinterOutput | |
parent | 025ef743ee06d81b43ac3d000ae3b64eb06b119d (diff) |
Show more information about errors we're getting
Show the error code we received in the GUI, and allow expansion for different types of errors.
Contributes to issue CURA-8609.
Diffstat (limited to 'cura/PrinterOutput')
-rw-r--r-- | cura/PrinterOutput/UploadMaterialsJob.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cura/PrinterOutput/UploadMaterialsJob.py b/cura/PrinterOutput/UploadMaterialsJob.py index 3560b32a70..57f6332755 100644 --- a/cura/PrinterOutput/UploadMaterialsJob.py +++ b/cura/PrinterOutput/UploadMaterialsJob.py @@ -81,12 +81,20 @@ class UploadMaterialsJob(Job): def onUploadCompleted(self, reply: "QNetworkReply", error: Optional["QNetworkReply.NetworkError"]): if error is not None: Logger.error(f"Failed to upload material archive: {error}") + self.setError(UploadMaterialsError(error)) self.setResult(self.Result.FAILED) else: self.setResult(self.Result.SUCCESS) - self.uploadCompleted.emit(self.getResult()) + self.uploadCompleted.emit(self.getResult(), self.getError()) def onError(self, reply: "QNetworkReply", error: Optional["QNetworkReply.NetworkError"]): Logger.error(f"Failed to upload material archive: {error}") self.setResult(self.Result.FAILED) - self.uploadCompleted.emit(self.getResult())
\ No newline at end of file + self.setError(UploadMaterialsError(error)) + self.uploadCompleted.emit(self.getResult(), self.getError()) + +class UploadMaterialsError(Exception): + """ + Marker class to indicate something went wrong while uploading. + """ + pass
\ No newline at end of file |