]> source.dussan.org Git - redmine.git/commitdiff
MailHandler: exit with 75 when a SystemCallError is raised (#12528).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 8 Dec 2012 09:14:06 +0000 (09:14 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 8 Dec 2012 09:14:06 +0000 (09:14 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10954 e93f8b46-1217-0410-a6f0-8f06a7374b81

extra/mail_handler/rdm-mailhandler.rb

index 42622e7081037a0c197b43f5883117268a4a6a67..d840422605475ca1279cf741edecd7122544d61d 100644 (file)
@@ -99,7 +99,12 @@ class RedmineMailHandler
     issue_attributes.each { |attr, value| data["issue[#{attr}]"] = value }
 
     debug "Posting to #{uri}..."
-    response = Net::HTTPS.post_form(URI.parse(uri), data, headers, :no_check_certificate => no_check_certificate)
+    begin
+      response = Net::HTTPS.post_form(URI.parse(uri), data, headers, :no_check_certificate => no_check_certificate)
+    rescue SystemCallError => e # connection refused, etc.
+      warn "An error occured while contacting your Redmine server: #{e.message}"
+      return 75 # temporary failure
+    end
     debug "Response received: #{response.code}"
 
     case response.code.to_i