From cc310ea0eda3a0b6e80a16c3e812617ea165b170 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Wed, 1 Nov 2006 03:53:00 +0000 Subject: - make create-srpm handle exceptions intended to be handled, so that we don't receive the ugly traceback when upload-srpm fails --- create-srpm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/create-srpm b/create-srpm index 67f6f15..b8004a2 100755 --- a/create-srpm +++ b/create-srpm @@ -63,7 +63,8 @@ class CmdIface: upload_command.append(x) upload_command.append(targetname) upload_command.append(targetsrpms[0]) - status, output = execcmd(" ".join(upload_command)) + status, output = execcmd(" ".join(upload_command), + noerror=1) if status != 0: raise CmdError, "Failed to upload %s:\n%s" % (targetsrpms[0], output) return 1 @@ -92,7 +93,11 @@ def parse_options(): def main(): iface = CmdIface() opts, args = parse_options() - iface.submit_package(args[0], opts.revision, opts.target, opts.urlmap, opts.define) + try: + iface.submit_package(args[0], opts.revision, opts.target, opts.urlmap, opts.define) + except Error, e: + sys.stderr.write("error: %s\n" % str(e)) + sys.exit(1) if __name__ == "__main__": -- cgit v1.2.1