]> git.cworth.org Git - sup/commitdiff
write sup-{exception-log, unable-to-decode}.txt in ~/.sup
authorNicolas Pouillard <nicolas.pouillard@gmail.com>
Thu, 3 Apr 2008 14:16:19 +0000 (16:16 +0200)
committerWilliam Morgan <w@shiny.(none)>
Wed, 23 Apr 2008 01:02:14 +0000 (18:02 -0700)
More precisely new destinations are:
  - ~/.sup/exception-log.txt
  - ~/.sup/unable-to-decode.txt
This patch avoid some kind of pollution.

bin/sup
lib/sup/message.rb

diff --git a/bin/sup b/bin/sup
index 523c685fcf49da16c984df58a4648e69743f75d2..078a13405946dcd82ad9813c40ffd505ce014aab 100644 (file)
--- a/bin/sup
+++ b/bin/sup
@@ -327,7 +327,7 @@ ensure
 end
 
 unless $exceptions.empty?
-  File.open("sup-exception-log.txt", "w") do |f|
+  File.open(File.join(BASE_DIR, "exception-log.txt"), "w") do |f|
     $exceptions.each do |e, name|
       f.puts "--- #{e.class.name} from thread: #{name}"
       f.puts e.message, e.backtrace
@@ -337,7 +337,7 @@ unless $exceptions.empty?
 ----------------------------------------------------------------
 I'm very sorry. It seems that an error occurred in Sup. Please
 accept my sincere apologies. If you don't mind, please send the
-contents of sup-exception-log.txt and a brief report of the
+contents of ~/.sup/exception-log.txt and a brief report of the
 circumstances to sup-talk at rubyforge dot orgs so that I might
 address this problem. Thank you!
 
index 6a2a9c47a021e69003af0cad6a2f076fc9a1dd4a..249b6c6e0ef03e55f715c3460c3d6a1bbc49889d 100644 (file)
@@ -423,7 +423,7 @@ private
       Iconv.iconv($encoding + "//IGNORE", charset, body + " ").join[0 .. -2]
     rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence, MessageFormatError => e
       Redwood::log "warning: error (#{e.class.name}) decoding message body from #{charset}: #{e.message}"
-      File.open("sup-unable-to-decode.txt", "w") { |f| f.write body }
+      File.open(File.join(BASE_DIR,"unable-to-decode.txt"), "w") { |f| f.write body }
       body
     end
   end