mirror of https://github.com/zulip/zulip.git
upgrade: Show fewer stacktraces.
The stacktraces here are seldom useful -- for the calls to upgrade-stage-2, we know precisely what was run. For the `run` wrapper, the output contains the command that failed, which is sufficient to identify where in the upgrade process it was. Showing more stacktrace below the actual error merely confuses users and scrolls the real error off of the screen.
This commit is contained in:
parent
dd3fa4ac52
commit
4c8502f7fd
|
@ -65,8 +65,13 @@ try:
|
||||||
# version is much better for fixing bugs in the upgrade process).
|
# version is much better for fixing bugs in the upgrade process).
|
||||||
deploy_path = deploy_path.strip()
|
deploy_path = deploy_path.strip()
|
||||||
os.chdir(deploy_path)
|
os.chdir(deploy_path)
|
||||||
subprocess.check_call(
|
try:
|
||||||
[os.path.abspath("./scripts/lib/upgrade-zulip-stage-2"), deploy_path, *deploy_options]
|
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:
|
finally:
|
||||||
release_deployment_lock()
|
release_deployment_lock()
|
||||||
|
|
|
@ -85,13 +85,18 @@ try:
|
||||||
|
|
||||||
overwrite_symlink(deploy_path, os.path.join(DEPLOYMENTS_DIR, "next"))
|
overwrite_symlink(deploy_path, os.path.join(DEPLOYMENTS_DIR, "next"))
|
||||||
|
|
||||||
subprocess.check_call(
|
try:
|
||||||
[
|
subprocess.check_call(
|
||||||
os.path.join(deploy_path, "scripts", "lib", "upgrade-zulip-stage-2"),
|
[
|
||||||
deploy_path,
|
os.path.join(deploy_path, "scripts", "lib", "upgrade-zulip-stage-2"),
|
||||||
"--from-git",
|
deploy_path,
|
||||||
*deploy_options,
|
"--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:
|
finally:
|
||||||
release_deployment_lock()
|
release_deployment_lock()
|
||||||
|
|
|
@ -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(WHITEONRED + "Actual error output for the subcommand is just above this." + ENDC)
|
||||||
print()
|
print()
|
||||||
raise
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def log_management_command(cmd: Sequence[str], log_path: str) -> None:
|
def log_management_command(cmd: Sequence[str], log_path: str) -> None:
|
||||||
|
|
Loading…
Reference in New Issue