diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-09-27 13:52:14 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-09-27 13:52:14 +0200 |
commit | 2ed8235cdb9e92b0bc46ee97ddbf4c4a1f70c6d8 (patch) | |
tree | 03c50cb18860c3ecb41d207a14c1d412b7b2f39b /lib/rbot/ircbot.rb | |
parent | 284bcbf4b29184717cd2e0986d4c2007ee6a930c (diff) |
* wrap BDB::Fatal classes for abstract trapping
When using a DB backend different from BDB, the BDB constant may not be
defined, causing a NameError during error trapping in the main loop. Fix
this by defining our own DBFatal error that maps to BDB::Fatal in the
BDB case and is defined as an (unused) Exception for TokyoCabinet.
Diffstat (limited to 'lib/rbot/ircbot.rb')
-rw-r--r-- | lib/rbot/ircbot.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 47d3063c..9b6e2d6a 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -1017,8 +1017,8 @@ class Bot quit_msg = "server ERROR: " + e.message too_fast = e.message.index("reconnect too fast") retry - rescue BDB::Fatal => e - fatal "fatal bdb error: #{e.pretty_inspect}" + rescue DBFatal => e + fatal "fatal db error: #{e.pretty_inspect}" DBTree.stats # Why restart? DB problems are serious stuff ... # restart("Oops, we seem to have registry problems ...") |