summaryrefslogtreecommitdiff
path: root/lib/chef/monkey_patches/net_http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/monkey_patches/net_http.rb')
-rw-r--r--lib/chef/monkey_patches/net_http.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/chef/monkey_patches/net_http.rb b/lib/chef/monkey_patches/net_http.rb
new file mode 100644
index 0000000000..ad4ba957f6
--- /dev/null
+++ b/lib/chef/monkey_patches/net_http.rb
@@ -0,0 +1,22 @@
+
+# Module gets mixed in to Net::HTTP exception classes so we can attach our
+# RESTRequest object to them and get the request parameters back out later.
+module ChefNetHTTPExceptionExtensions
+ attr_accessor :chef_rest_request
+end
+
+require 'net/http'
+module Net
+ class HTTPError
+ include ChefNetHTTPExceptionExtensions
+ end
+ class HTTPRetriableError
+ include ChefNetHTTPExceptionExtensions
+ end
+ class HTTPServerException
+ include ChefNetHTTPExceptionExtensions
+ end
+ class HTTPFatalError
+ include ChefNetHTTPExceptionExtensions
+ end
+end