lib/mina/instana.rb in mina-instana-0.1.5 vs lib/mina/instana.rb in mina-instana-0.1.6

- old
+ new

@@ -27,10 +27,12 @@ req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json') req.body = payload.to_json Net::HTTP.start(uri.hostname, uri.port) do |http| http.request(req) end + rescue Errno::ECONNREFUSED + print_error "The Instana host agent isn't running on localhost. Can't post deploy notifications." rescue => e print_error "Error posting notification to Instana: #{e.inspect}" end end @@ -53,10 +55,12 @@ req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json') req.body = payload.to_json Net::HTTP.start(uri.hostname, uri.port) do |http| http.request(req) end - rescue + rescue Errno::ECONNREFUSED + print_error "The Instana host agent isn't running on localhost. Can't post deploy notifications." + rescue => e print_error "Error posting notification to Instana: #{e.inspect}" end end end