summaryrefslogtreecommitdiff
path: root/lib/rbot/config.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-18 14:44:17 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2006-07-18 14:44:17 +0000
commit0d7772ca24e6683f3e2c43f6d5dae709d6d7b16b (patch)
tree1cc95fc155938e31417aad84e92251c43c009992 /lib/rbot/config.rb
parentb756b6655d94e3aedecb25c54ca27ab64f68b7f6 (diff)
Improve robustness while saving auth config files and channel quotes
Diffstat (limited to 'lib/rbot/config.rb')
-rw-r--r--lib/rbot/config.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rbot/config.rb b/lib/rbot/config.rb
index 027b9902..c974c78f 100644
--- a/lib/rbot/config.rb
+++ b/lib/rbot/config.rb
@@ -328,13 +328,17 @@ module Irc
# write current configuration to #{botclass}/conf.rbot
def save
begin
+ debug "Writing new conf.yaml ..."
File.open("#{@@bot.botclass}/conf.yaml.new", "w") do |file|
file.puts @@config.to_yaml
end
+ debug "Officializing conf.yaml ..."
File.rename("#{@@bot.botclass}/conf.yaml.new",
"#{@@bot.botclass}/conf.yaml")
- rescue
+ rescue => e
$stderr.puts "failed to write configuration file conf.yaml! #{$!}"
+ debug "#{e.class}: #{e}"
+ debug e.backtrace.join("\n")
end
end