Improved error message for configuration files
This commit is contained in:
parent
ed1b34c724
commit
778e44e39e
2 changed files with 17 additions and 1 deletions
|
|
@ -116,7 +116,11 @@ class Config(dict):
|
|||
filename = os.path.join(self.root_path, filename)
|
||||
d = type(sys)('config')
|
||||
d.__file__ = filename
|
||||
execfile(filename, d.__dict__)
|
||||
try:
|
||||
execfile(filename, d.__dict__)
|
||||
except IOError, e:
|
||||
e.strerror = 'Unable to load configuration file (%s)' % e.strerror
|
||||
raise
|
||||
self.from_object(d)
|
||||
|
||||
def from_object(self, obj):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue