mirror of
https://github.com/morgan9e/warehouse
synced 2026-04-14 00:04:08 +09:00
Use better error messages
This commit is contained in:
@@ -63,15 +63,15 @@ class ChangeVersionWorker:
|
||||
|
||||
this.process.wait(timeout=10)
|
||||
if error := this.process.communicate()[1].strip():
|
||||
this.on_error(_("Could not change version"), error)
|
||||
this.on_error(_("Error occurred while changing version"), error)
|
||||
|
||||
except subprocess.TimeoutExpired as te:
|
||||
this.process.terminate()
|
||||
this.on_error(_("Could not change version"), _("Failed to exit cleanly"))
|
||||
this.on_error(_("Error occurred while changing version"), _("Failed to exit cleanly"))
|
||||
|
||||
except Exception as e:
|
||||
this.process.terminate()
|
||||
this.on_error(_("Could not change version"), str(e))
|
||||
this.on_error(_("Error occurred while changing version"), str(e))
|
||||
|
||||
@classmethod
|
||||
def cancel(this):
|
||||
|
||||
@@ -81,15 +81,15 @@ class PackageInstallWorker:
|
||||
errors.append(error)
|
||||
|
||||
if len(errors) > 0:
|
||||
this.on_error(_("Could not install some packages"), "\n".join(errors))
|
||||
this.on_error(_("Errors occurred during installation"), "\n".join(errors))
|
||||
|
||||
except subprocess.TimeoutExpired as te:
|
||||
this.process.terminate()
|
||||
this.on_error(_("Could not install some packages"), _("Failed to exit cleanly"))
|
||||
this.on_error(_("Error occurred during installation"), _("Failed to exit cleanly"))
|
||||
|
||||
except Exception as e:
|
||||
this.process.terminate()
|
||||
this.on_error(_("Could not install some packages"), str(e))
|
||||
this.on_error(_("Error occurred during installation"), str(e))
|
||||
|
||||
@classmethod
|
||||
def cancel(this):
|
||||
@@ -132,7 +132,7 @@ class PackageInstallWorker:
|
||||
this.error_callback = error_callback
|
||||
|
||||
if this.total_groups < 1:
|
||||
this.on_error(_("Could not install packages"), _("No packages were asked to be installed."))
|
||||
this.on_error(_("Could not install packages"), _("No packages were requested to be installed."))
|
||||
return False
|
||||
|
||||
HostInfo.main_window.add_refresh_lockout("installing packages")
|
||||
|
||||
Reference in New Issue
Block a user