Browse code

catch error message on parsing ini files

Hanno Böck authored on09/01/2017 17:51:56
Showing1 changed files
... ...
@@ -100,9 +100,12 @@ opts, args = parser.parse_args()
100 100
 
101 101
 # Parse vulnerability database
102 102
 config = configparser.ConfigParser()
103
-config.read(glob.glob('/usr/share/freewvs/*.freewvs'))
104
-config.read(glob.glob('/usr/local/share/freewvs/*.freewvs'))
105
-config.read(glob.glob(os.path.dirname(sys.argv[0])+'/freewvsdb/*.freewvs'))
103
+try:
104
+    config.read(glob.glob('/usr/share/freewvs/*.freewvs'))
105
+    config.read(glob.glob('/usr/local/share/freewvs/*.freewvs'))
106
+    config.read(glob.glob(os.path.dirname(sys.argv[0])+'/freewvsdb/*.freewvs'))
107
+except configparser.MissingSectionHeaderError as err:
108
+    print("Error parsing config files: %s" % err);
106 109
 
107 110
 vdb = []
108 111
 for sect in config.sections():