Browse Source

Merge pull request #469 from fernandoacorreia/load-exception-handling

Handle exception loading config file
Brian Hauer 12 years ago
parent
commit
490d204a5f
1 changed files with 7 additions and 2 deletions
  1. 7 2
      toolset/benchmark/benchmarker.py

+ 7 - 2
toolset/benchmark/benchmarker.py

@@ -216,9 +216,14 @@ class Benchmarker:
       # }
       if 'benchmark_config' in filenames:
         config = None
-        with open(os.path.join(dirname, 'benchmark_config'), 'r') as config_file:
+        config_file_name = os.path.join(dirname, 'benchmark_config')
+        with open(config_file_name, 'r') as config_file:
           # Load json file into config object
-          config = json.load(config_file)
+          try:
+            config = json.load(config_file)
+          except:
+            print("Error loading '%s'." % config_file_name)
+            raise
 
         if config == None:
           continue