deltacloud-client 0.3.0 will raise timeouts when connections are
excessively slow; this makes Conductor a bit smarter about catching
this exception and displaying a flash message to the user.
---
src/app/controllers/application_controller.rb | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/app/controllers/application_controller.rb
b/src/app/controllers/application_controller.rb
index 6bda765..7d82f26 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -36,6 +36,7 @@ class ApplicationController < ActionController::Base
rescue_from ActionError, :with => :handle_action_error
rescue_from PartialSuccessError, :with => :handle_partial_success_error
rescue_from ActiveRecord::RecordNotFound, :with =>
:handle_active_record_not_found_error
+ rescue_from RestClient::RequestTimeout, :with => :handle_request_timeout_error
helper_method :check_privilege
@@ -85,6 +86,12 @@ class ApplicationController < ActionController::Base
end
end
+ # A Timeout is not necessarily fatal; return to request.referrer rather than an error
page
+ def handle_request_timeout_error(error)
+ flash[:error] = "The Provider timed out. Please try again."
+ redirect_to request.referrer
+ end
+
def html_error_page(title, msg)
if request.xhr?
render :template => 'layouts/popup-error', :layout =>
'popup',
--
1.7.4.2