mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
Added exception handling for bad files or missing files
This commit is contained in:
parent
e51ff81dbe
commit
c49fb9586f
1 changed files with 11 additions and 5 deletions
|
@ -28,8 +28,14 @@ class config(ConfigParser.ConfigParser):
|
|||
MissingSectionHeaderError = ConfigParser.MissingSectionHeaderError
|
||||
|
||||
def __init__(self, *file):
|
||||
ConfigParser.ConfigParser.__init__(self)
|
||||
self.optionxform = str
|
||||
if not file:
|
||||
file = CONFIG_FILE
|
||||
self.read(file)
|
||||
try:
|
||||
ConfigParser.ConfigParser.__init__(self)
|
||||
self.optionxform = str
|
||||
if not file:
|
||||
file = CONFIG_FILE
|
||||
if self.read(file):
|
||||
pass
|
||||
else:
|
||||
raise self.Error('Cannot open configuration file')
|
||||
except IOError, error:
|
||||
exit(error)
|
Loading…
Add table
Add a link
Reference in a new issue