mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-03 01:39:23 +01:00
Better error handling on open.
This commit is contained in:
parent
3776788694
commit
68eb84c0bb
@ -516,7 +516,11 @@ class UsersDictionary(utils.IterableMap):
|
||||
def open(self, filename):
|
||||
self.filename = filename
|
||||
reader = unpreserve.Reader(IrcUserCreator, self)
|
||||
try:
|
||||
reader.readFile(filename)
|
||||
except Exception, e:
|
||||
log.error('Invalid user dictionary file, starting from scratch.')
|
||||
log.error('Exact error: %s', utils.exnToString(e))
|
||||
|
||||
def reload(self):
|
||||
"""Reloads the database from its file."""
|
||||
@ -675,7 +679,11 @@ class ChannelsDictionary(utils.IterableMap):
|
||||
def open(self, filename):
|
||||
self.filename = filename
|
||||
reader = unpreserve.Reader(IrcChannelCreator, self)
|
||||
try:
|
||||
reader.readFile(filename)
|
||||
except Exception, e:
|
||||
log.error('Invalid channel database, starting from scratch.')
|
||||
log.error('Exact error: %s', utils.exnToString(e))
|
||||
|
||||
def flush(self):
|
||||
"""Flushes the channel database to its file."""
|
||||
|
Loading…
Reference in New Issue
Block a user