diff options
author | Jesse Campbell <hikeit@gmail.com> | 2013-02-11 18:24:32 -0500 |
---|---|---|
committer | Jesse Campbell <hikeit@gmail.com> | 2013-02-11 18:24:32 -0500 |
commit | f064ca37b8c87836ec7613425634ef53a826d376 (patch) | |
tree | a1bfff2200e465373410ce7a448d1f54092dc14d /lib/chef/provider/remote_file.rb | |
parent | 148432480615ea1dd4c706ba542450339a9abc14 (diff) | |
download | chef-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.rb | 7 |
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 |