diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2024-11-17 11:53:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-17 10:53:41 +0000 |
commit | 0d2ce68d5006214a5aa4c5b7e98c9073f135db7c (patch) | |
tree | a23f6ae5f763fe274c411998b95e59a5c24a6548 /python/servo | |
parent | dca33f681ab6b33e2680d053add83e30e01665bd (diff) | |
download | servo-0d2ce68d5006214a5aa4c5b7e98c9073f135db7c.tar.gz servo-0d2ce68d5006214a5aa4c5b7e98c9073f135db7c.zip |
mach: ohos: Print error message when hvigor fails (#34267)
`hvigorw --version` might fail if some required environment variables
are not set. In this case we should print the output of the command,
so that the user can report what caused `hvigorw --version` to fail.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/package_commands.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index e8c2a6e6460..0ecc376f93d 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -224,6 +224,12 @@ class PackageCommands(CommandBase): "path to hvigorw or set the HVIGOR_PATH environment variable to the npm" "installation containing `node_modules` directory with hvigor modules.") sys.exit(1) + except subprocess.CalledProcessError as e: + print(f"hvigor exited with the following error: {e}") + print(f"stdout: `{e.stdout}`") + print(f"stderr: `{e.stderr}`") + sys.exit(1) + else: env["NODE_PATH"] = env["HVIGOR_PATH"] + "/node_modules" hvigor_script = f"{env['HVIGOR_PATH']}/node_modules/@ohos/hvigor/bin/hvigor.js" |