From 04c4bfb50b64eada1b77d1d8ffd4751907c45dac Mon Sep 17 00:00:00 2001 From: heliguy4599 Date: Fri, 11 Oct 2024 21:37:37 -0400 Subject: [PATCH] Use better error messages --- src/change_version_page/change_version_worker.py | 6 +++--- src/package_install_worker.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/change_version_page/change_version_worker.py b/src/change_version_page/change_version_worker.py index fe06dd4..8aa32e6 100644 --- a/src/change_version_page/change_version_worker.py +++ b/src/change_version_page/change_version_worker.py @@ -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): diff --git a/src/package_install_worker.py b/src/package_install_worker.py index 1b75299..6ff0542 100644 --- a/src/package_install_worker.py +++ b/src/package_install_worker.py @@ -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")