Handle configparser exceptions

Change-Id: I31949a3a1d23e2f254cb53260f9c42f8005d978f
This commit is contained in:
Christian Berendt 2014-08-08 09:02:14 +02:00
parent 70918715bf
commit 60a0a5fe8a
1 changed files with 6 additions and 1 deletions

View File

@ -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)