MailHandler: exit with 75 when a SystemCallError is raised (#12528).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10954 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-12-08 09:14:06 +00:00
parent cf69c2da21
commit 00d16d07de
1 changed files with 6 additions and 1 deletions

View File

@ -99,7 +99,12 @@ class RedmineMailHandler
issue_attributes.each { |attr, value| data["issue[#{attr}]"] = value } issue_attributes.each { |attr, value| data["issue[#{attr}]"] = value }
debug "Posting to #{uri}..." 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}" debug "Response received: #{response.code}"
case response.code.to_i case response.code.to_i