summaryrefslogtreecommitdiff
path: root/lib/chef/provider/remote_file.rb
diff options
context:
space:
mode:
authorJesse Campbell <hikeit@gmail.com>2013-02-11 18:24:32 -0500
committerJesse Campbell <hikeit@gmail.com>2013-02-11 18:24:32 -0500
commitf064ca37b8c87836ec7613425634ef53a826d376 (patch)
treea1bfff2200e465373410ce7a448d1f54092dc14d /lib/chef/provider/remote_file.rb
parent148432480615ea1dd4c706ba542450339a9abc14 (diff)
downloadchef-f064ca37b8c87836ec7613425634ef53a826d376.tar.gz
add additional exception details for restclient
Diffstat (limited to 'lib/chef/provider/remote_file.rb')
-rw-r--r--lib/chef/provider/remote_file.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/provider/remote_file.rb b/lib/chef/provider/remote_file.rb
index d87715fece..44fa0ca5e9 100644
--- a/lib/chef/provider/remote_file.rb
+++ b/lib/chef/provider/remote_file.rb
@@ -101,7 +101,12 @@ class Chef
rescue ArgumentError => e
raise e
rescue => e
- Chef::Log.debug("#{@new_resource} cannot be downloaded from #{source}")
+ if e.is_a?(RestClient::Exception)
+ error = "\nRequest returned #{e.message}\nresponse: #{e.response}"
+ else
+ error = e.to_s
+ end
+ Chef::Log.debug("#{@new_resource} cannot be downloaded from #{source}: #{error}")
if source = sources.shift
Chef::Log.debug("#{@new_resource} trying to download from another mirror")
retry