bin/calabash-ios-setup.rb in calabash-cucumber-0.9.67 vs bin/calabash-ios-setup.rb in calabash-cucumber-0.9.68

- old
+ new

@@ -119,10 +119,11 @@ proxy_url = proxy connection = Net::HTTP::Proxy(proxy_url[0], proxy_url[1]) else connection = Net::HTTP end + begin connection.start(uri.host, uri.port) do |http| request = Net::HTTP::Get.new uri.request_uri http.request request do |response| if response.code == '200' @@ -136,9 +137,16 @@ else puts "Got bad response code #{response.code}." puts "Aborting..." end end + end + rescue SocketError => e + msg("Error") do + puts "Exception: #{e}" + puts "Unable to download Calabash. Please check connection." + end + exit 1 end if success puts "\nDownload done: #{file}. Unzipping..." if not system("unzip -C -K -o -q -d #{project_path} #{zip_file}") msg("Error") do \ No newline at end of file