Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upgrade: Show fewer stacktraces.

Alex Vandiver4c8502f7fd11
diff --git a/scripts/lib/upgrade-zulip b/scripts/lib/upgrade-zulip
index 20097aeaa59..34ac07eef66 100755
--- a/scripts/lib/upgrade-zulip
+++ b/scripts/lib/upgrade-zulip
@@ -65,8 +65,13 @@ try:
# version is much better for fixing bugs in the upgrade process).
deploy_path = deploy_path.strip()
os.chdir(deploy_path)
- subprocess.check_call(
- [os.path.abspath("./scripts/lib/upgrade-zulip-stage-2"), deploy_path, *deploy_options]
- )
+ try:
+ subprocess.check_call(
+ [os.path.abspath("./scripts/lib/upgrade-zulip-stage-2"), deploy_path, *deploy_options]
+ )
+ except subprocess.CalledProcessError:
+ # There's no use in showing a stacktrace here; it just hides
+ # the error from stage 2.
+ sys.exit(1)
finally:
release_deployment_lock()
diff --git a/scripts/lib/upgrade-zulip-from-git b/scripts/lib/upgrade-zulip-from-git
index a151646f81c..7a2c47b16f0 100755
--- a/scripts/lib/upgrade-zulip-from-git
+++ b/scripts/lib/upgrade-zulip-from-git
@@ -85,13 +85,18 @@ try:
overwrite_symlink(deploy_path, os.path.join(DEPLOYMENTS_DIR, "next"))
- subprocess.check_call(
- [
- os.path.join(deploy_path, "scripts", "lib", "upgrade-zulip-stage-2"),
- deploy_path,
- "--from-git",
- *deploy_options,
- ]
- )
+ try:
+ subprocess.check_call(
+ [
+ os.path.join(deploy_path, "scripts", "lib", "upgrade-zulip-stage-2"),
+ deploy_path,
+ "--from-git",
+ *deploy_options,
+ ]
+ )
+ except subprocess.CalledProcessError:
+ # There's no use in showing a stacktrace here; it just hides
+ # the error from stage 2.
+ sys.exit(1)
finally:
release_deployment_lock()
diff --git a/scripts/lib/zulip_tools.py b/scripts/lib/zulip_tools.py
index 71f30c4296d..493332f3eed 100755
--- a/scripts/lib/zulip_tools.py
+++ b/scripts/lib/zulip_tools.py
@@ -238,7 +238,7 @@ def run(args: Sequence[str], **kwargs: Any) -> None:
)
print(WHITEONRED + "Actual error output for the subcommand is just above this." + ENDC)
print()
- raise
+ sys.exit(1)
def log_management_command(cmd: Sequence[str], log_path: str) -> None: