Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 967504 - web console now properly handling app creation timeout
  • Loading branch information
fabianofranz committed Jun 19, 2013
1 parent ca2e507 commit 94c624e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion console/app/controllers/applications_controller.rb
Expand Up @@ -150,7 +150,14 @@ def create
end
@application.domain = @domain

if @application.save
saved = false
begin
saved = @application.save
rescue ActiveResource::TimeoutError
flash.now[:error] = "The application creation timed out. Your app is probably still being created in background. Please give it a couple minutes and check the 'My Applications' section."
end

if saved
messages = @application.remote_results

redirect_to get_started_application_path(@application, :wizard => true), :flash => {:info_pre => messages}
Expand Down
2 changes: 1 addition & 1 deletion console/lib/active_resource/persistent_connection.rb
Expand Up @@ -175,7 +175,7 @@ def request(method, path, *arguments)
rescue OpenSSL::SSL::SSLError => e
raise SSLError.new(e.message)
rescue Net::HTTP::Persistent::Error => e
raise ConnectionError.new(e.message)
raise e.message.include?('Timeout::Error') ? TimeoutError.new(e.message) : ConnectionError.new(e.message)
rescue Errno::ECONNREFUSED => e
raise ServerRefusedConnection.new(site, req.path)
end
Expand Down

0 comments on commit 94c624e

Please sign in to comment.