Commit a24f85fa authored by Nicolas Chevillot's avatar Nicolas Chevillot

Improved error message in case an option is defined with inadequate type

parent c4b5fced
...@@ -373,8 +373,8 @@ types:[<type 'int'>] ...@@ -373,8 +373,8 @@ types:[<type 'int'>]
opt = self[opt_name] opt = self[opt_name]
if type(val) not in opt.types: if type(val) not in opt.types:
raise RuntimeError( raise RuntimeError(
"Given option (%s) doesn't match specified types: (%s)" % "Given option '%s' is of type %s: '%s', it doesn't match allowed types: (%s), file %s" %
(str(type(val)), str(opt.types))) (opt_name, str(type(val)), val, str(opt.types), self.config_file))
ret[opt_name] = val ret[opt_name] = val
# Thi is only for the options of the dictionary class: # Thi is only for the options of the dictionary class:
if isinstance(val, type(dict())): if isinstance(val, type(dict())):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment