Browse Source

Handle exception loading config file

Prints a debugging message if there is an exception loading the configuration file.
Fernando Correia 12 years ago
parent
commit
cbe9771c13
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