From 2ed8235cdb9e92b0bc46ee97ddbf4c4a1f70c6d8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 27 Sep 2010 13:52:14 +0200 Subject: * 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. --- lib/rbot/registry/bdb.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/rbot/registry/bdb.rb') 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." -- cgit v1.2.3