From 308778e3129a71fab44c920f47c196995bc54d82 Mon Sep 17 00:00:00 2001 From: Lyle Franklin Date: Tue, 3 May 2016 15:25:03 -0700 Subject: [PATCH] Log AWS socket error backtrace instead of including in exception - Presents more readable output to the user initially, while still preserving information in debug logs [#116382509](https://www.pivotaltracker.com/story/show/116382509) --- src/bosh_aws_cpi/lib/cloud/aws/cloud.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bosh_aws_cpi/lib/cloud/aws/cloud.rb b/src/bosh_aws_cpi/lib/cloud/aws/cloud.rb index 6c8509b6..c78b7603 100644 --- a/src/bosh_aws_cpi/lib/cloud/aws/cloud.rb +++ b/src/bosh_aws_cpi/lib/cloud/aws/cloud.rb @@ -737,7 +737,8 @@ def aws_accessible? @ec2_client.regions.first true rescue SocketError => socket_error - cloud_error("Unable to create a connection to AWS; please check your region or EC2 endpoint.\nIaaS Error: #{socket_error.inspect}\nBacktrace: #{socket_error.backtrace.join("\n")}") + logger.error("Failed to connect to AWS: #{socket_error.inspect}\n#{socket_error.backtrace.join("\n")}") + cloud_error("Unable to create a connection to AWS; please check your region or EC2 endpoint.\nIaaS Error: #{socket_error.inspect}") rescue Net::OpenTimeout => e false end