summaryrefslogtreecommitdiff
path: root/lib/rbot/ircbot.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbot/ircbot.rb')
-rw-r--r--lib/rbot/ircbot.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index d513cb71..8e6fabac 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -376,11 +376,19 @@ class IrcBot
rescue SystemExit
exit 0
rescue TimeoutError, SocketError => e
- puts "#{e.class}: #{e}"
+ puts "network exception: #{e.class}: #{e}"
+ debug e.inspect
debug e.backtrace.join("\n")
+ rescue BDB::Fatal => e
+ puts "fatal bdb error: #{e.class}: #{e}"
+ debug e.inspect
+ debug e.backtrace.join("\n")
+ DBTree.stats
+ restart("Oops, we seem to have registry problems ...")
rescue Exception => e
- puts "network exception: #{e.inspect}"
- puts e.backtrace.join("\n")
+ puts "non-net exception: #{e.class}: #{e}"
+ debug e.inspect
+ debug e.backtrace.join("\n")
@socket.shutdown # now we reconnect
rescue => e
puts "unexpected exception: connection closed: #{e.inspect}"
@@ -545,6 +553,7 @@ class IrcBot
shutdown(msg)
sleep @config['server.reconnect_wait']
# now we re-exec
+ # Note, this fails on Windows
exec($0, *@argv)
end