From eec4ecd325afa844cd2f535b5e41a72b2b71ae4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Seux?= Date: Wed, 1 Mar 2017 10:49:52 +0100 Subject: [PATCH] Add a comment to explain ::StandardError vs StandardError Change-Id: I631d42dd09163417f260adfb8d3e26c58f604fff --- lib/kitchen/driver/ec2.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/kitchen/driver/ec2.rb b/lib/kitchen/driver/ec2.rb index e1fcc73a..72b58e7c 100644 --- a/lib/kitchen/driver/ec2.rb +++ b/lib/kitchen/driver/ec2.rb @@ -233,21 +233,10 @@ def destroy(state) unless server.nil? begin instance.transport.connection(state).close - rescue ::StandardError => ex + rescue ::StandardError => ex # NOTE: using :: is really important as there is another kind of StandardError defined in this context # We don't care if this fails, and it does so regularly for an # unknown reason info("Error closing connection with message: #{ex.class.name} #{ex.message} #{ex.backtrace}") - rescue Exception => ex - info("For an unkwown reason, #{ex.class.name} is not caught as a StandardError") - info(<<-EOH) - Details: - #{ex.inspect} - is a standard error: #{ex.is_a?(StandardError)} - is a standard error: #{ex.is_a?(::StandardError)} - parent class: #{ex.class.superclass.name} - grand parent class: #{ex.class.superclass.superclass.name} - EOH - raise end server.terminate end