From: Seth Vidal Date: Wed, 29 Oct 2008 03:27:03 +0000 (-0400) Subject: try/excepts on modifyrepo so we don't smack the user with a traceback X-Git-Tag: upstream/0.9.9~94 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04234b2400e3986b8694b175552926bb785f43c7;p=tools%2Fcreaterepo.git try/excepts on modifyrepo so we don't smack the user with a traceback --- diff --git a/modifyrepo.py b/modifyrepo.py index 558ec08..632d824 100755 --- a/modifyrepo.py +++ b/modifyrepo.py @@ -135,6 +135,14 @@ if __name__ == '__main__': if len(sys.argv) != 3 or '-h' in sys.argv: print "Usage: %s " % sys.argv[0] sys.exit() + try: + repomd = RepoMetadata(sys.argv[2]) + except Exception, e: + print "Could not access repository: %s" % str(e) + sys.exit(1) + try: + repomd.add(sys.argv[1]) + except Exception, e: + print "Could not add metadata from file %s: %s" % (sys.argv[1], str(e)) + sys.exit(1) - repomd = RepoMetadata(sys.argv[2]) - repomd.add(sys.argv[1])