summaryrefslogtreecommitdiff
path: root/lib/rbot/registry/bdb.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-09-27 13:52:14 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2010-09-27 13:52:14 +0200
commit2ed8235cdb9e92b0bc46ee97ddbf4c4a1f70c6d8 (patch)
tree03c50cb18860c3ecb41d207a14c1d412b7b2f39b /lib/rbot/registry/bdb.rb
parent284bcbf4b29184717cd2e0986d4c2007ee6a930c (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/registry/bdb.rb')
-rw-r--r--lib/rbot/registry/bdb.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rbot/registry/bdb.rb b/lib/rbot/registry/bdb.rb
index 200e38ee..5acfe491 100644
--- a/lib/rbot/registry/bdb.rb
+++ b/lib/rbot/registry/bdb.rb
@@ -15,6 +15,10 @@ if not defined? BDB
exit 2
end
+module Irc
+ DBFatal = BDB::Fatal
+end
+
if BDB::VERSION_MAJOR < 4
fatal "Your bdb (Berkeley DB) version #{BDB::VERSION} is too old!"
fatal "rbot will only run with bdb version 4 or higher, please upgrade."