mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 00:37:50 -06:00
Fix mypy issue in CreateBackupJob
CURA-7173
This commit is contained in:
parent
7f6afb9638
commit
6f4276c5cc
1 changed files with 5 additions and 1 deletions
|
@ -98,7 +98,11 @@ class CreateBackupJob(Job):
|
|||
if HttpRequestManager.safeHttpStatus(reply) == 400:
|
||||
errors = json.loads(replyText)["errors"]
|
||||
if "moreThanMaximum" in [error["code"] for error in errors if error["meta"] and error["meta"]["field_name"] == "backup_size"]:
|
||||
sentry_sdk.capture_message("backup failed: exceeded max size: {}".format(len(self._backup_zip)), level = "warning")
|
||||
if self._backup_zip is None: # will never happen; keep mypy happy
|
||||
zip_error = "backup is None."
|
||||
else:
|
||||
zip_error = "{} exceeds max size.".format(str(len(self._backup_zip)))
|
||||
sentry_sdk.capture_message("backup failed: {}".format(zip_error), level ="warning")
|
||||
self.backup_upload_error_message = catalog.i18nc("@error:file_size", "The backup exceeds the maximum file size.")
|
||||
from sentry_sdk import capture_message
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue