diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-18 09:07:44 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-18 09:14:25 +0000 |
commit | 936c3b2fb1365e46239ff98ab962460d0c459730 (patch) | |
tree | e3ab2d063117bd88df5bfcac43cf318d9744b9db /app/controllers/application_controller.rb | |
parent | 12805e8c61ba8f6e4235800332ad80e0b2f307f7 (diff) |
Catch timeouts and other extra errors when connection to 3rd party websites fails.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2cdd5ee35..1c73f06a7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -524,7 +524,7 @@ class ApplicationController < ActionController::Base def quietly_try_to_open(url) begin result = open(url).read.strip - rescue OpenURI::HTTPError, SocketError + rescue OpenURI::HTTPError, SocketError, Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH logger.warn("Unable to open third-party URL #{url}") result = "" end |