mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 22:13:58 -06:00
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.
This commit is contained in:
parent
025ef743ee
commit
125c80430b
2 changed files with 16 additions and 5 deletions
|
@ -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())
|
||||
self.setError(UploadMaterialsError(error))
|
||||
self.uploadCompleted.emit(self.getResult(), self.getError())
|
||||
|
||||
class UploadMaterialsError(Exception):
|
||||
"""
|
||||
Marker class to indicate something went wrong while uploading.
|
||||
"""
|
||||
pass
|
Loading…
Add table
Add a link
Reference in a new issue