From d5036967d4e3465da0fe1dafc7513fac82d4ea8c Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 12 Jul 2012 15:39:54 +0200 Subject: [PATCH] bug #1354: Handle exception when trying to connect to the marketplace --- src/cloud/common/CloudClient.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cloud/common/CloudClient.rb b/src/cloud/common/CloudClient.rb index a3a39ec6d4..3efebd4b5a 100644 --- a/src/cloud/common/CloudClient.rb +++ b/src/cloud/common/CloudClient.rb @@ -113,6 +113,12 @@ module CloudClient str << "Server: #{url.host}:#{url.port}" return CloudClient::Error.new(str,"504") + rescue SocketError => e + str = "Error timeout while connected to server (#{e.to_s}).\n" + + return CloudClient::Error.new(str,"503") + rescue + return CloudClient::Error.new($!.to_s,"503") end if res.is_a?(Net::HTTPSuccess)