From 60a0a5fe8a5ad93df12a2889f8b7d7daa40a9c27 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Fri, 8 Aug 2014 09:02:14 +0200 Subject: [PATCH] Handle configparser exceptions Change-Id: I31949a3a1d23e2f254cb53260f9c42f8005d978f --- gerrit_dash_creator/cmd/creator.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gerrit_dash_creator/cmd/creator.py b/gerrit_dash_creator/cmd/creator.py index a7f81cd..a1b2aa2 100755 --- a/gerrit_dash_creator/cmd/creator.py +++ b/gerrit_dash_creator/cmd/creator.py @@ -89,7 +89,12 @@ def main(): opts.dashboard_file) return 1 - dashboard = read_dashboard_file(opts.dashboard_file) + try: + dashboard = read_dashboard_file(opts.dashboard_file) + except configparser.Error as e: + print("error: dashboard file '%s' cannot be parsed\n\n%s" % + (opts.dashboard_file, e)) + return 1 try: url = generate_dashboard_url(dashboard)