diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index 5d809ab..c945455 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -347,7 +347,7 @@ def main(): parser.error("required crate/path argument missing") crate, diff, metadata, doc_files, license_files = make_diff_metadata( - args.crate, args.version, patch=args.patch, store=args.store_crate) + args.crate, args.version, patch=args.patch, store=args.store_crate) JINJA_ENV.globals["normalize_deps"] = normalize_deps JINJA_ENV.globals["to_list"] = to_list @@ -468,4 +468,10 @@ def main(): fobj.writelines(diff) if __name__ == "__main__": - main() + try: + main() + except requests.exceptions.HTTPError as e: + sys.exit(f'Failed to download metadata: {e}') + except subprocess.CalledProcessError as e: + cmd = shlex.join(e.cmd) + sys.exit(f'Subcommand failed with code {e.returncode}: {cmd}')