diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-08 09:14:06 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-08 09:14:06 +0000 |
commit | 00d16d07de69403541077ac1f0a4d62b71b6d9be (patch) | |
tree | f469f193e42a6f7f0c4201242791aca63f1c23d4 /extra | |
parent | cf69c2da214a7da99febee5bd334326c3219e0e5 (diff) | |
download | redmine-00d16d07de69403541077ac1f0a4d62b71b6d9be.tar.gz redmine-00d16d07de69403541077ac1f0a4d62b71b6d9be.zip |
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
Diffstat (limited to 'extra')
-rw-r--r-- | extra/mail_handler/rdm-mailhandler.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/extra/mail_handler/rdm-mailhandler.rb b/extra/mail_handler/rdm-mailhandler.rb index 42622e708..d84042260 100644 --- a/extra/mail_handler/rdm-mailhandler.rb +++ b/extra/mail_handler/rdm-mailhandler.rb @@ -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 |