From 3bd50b1d6a87c889b8d35f6968b59621b1c5e977 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 3 Feb 2004 03:07:54 +0000 Subject: [PATCH] Fixed testing, w00t! --- src/ircdb.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ircdb.py b/src/ircdb.py index 8ac18e37b..5dd5bbcb0 100644 --- a/src/ircdb.py +++ b/src/ircdb.py @@ -516,7 +516,10 @@ class UsersDictionary(utils.IterableMap): if self.filename is not None: self.nextId = 0 self.users.clear() - self.open(self.filename) + try: + self.open(self.filename) + except EnvironmentError, e: + log.warning('UsersDictionary.reload failed: %s', e) else: log.warning('UsersDictionary.reload called without self.filename.') @@ -660,15 +663,18 @@ class ChannelsDictionary(utils.IterableMap): c.preserve(fd, indent=' ') fd.close() else: - log.warning('ChannelsDictionary.flush called with self.filename.') + log.warning('ChannelsDictionary.flush without self.filename.') def reload(self): """Reloads the channel database from its file.""" if self.filename: self.channels.clear() - self.open(self.filename) + try: + self.open(self.filename) + except EnvironmentError, e: + log.warning('ChannelsDictionary.reload failed: %s', e) else: - log.warning('ChannelsDictionary.reload called with self.filename.') + log.warning('ChannelsDictionary.reload without self.filename.') def getChannel(self, channel): """Returns an IrcChannel object for the given channel."""