1# Net::HTTP exception class. 2# You cannot use Net::HTTPExceptions directly; instead, you must use 3# its subclasses. 4module Net::HTTPExceptions 5 def initialize(msg, res) #:nodoc: 6 super msg 7 @response = res 8 end 9 attr_reader :response 10 alias data response #:nodoc: obsolete 11end 12class Net::HTTPError < Net::ProtocolError 13 include Net::HTTPExceptions 14end 15class Net::HTTPRetriableError < Net::ProtoRetriableError 16 include Net::HTTPExceptions 17end 18class Net::HTTPServerException < Net::ProtoServerError 19 # We cannot use the name "HTTPServerError", it is the name of the response. 20 include Net::HTTPExceptions 21end 22class Net::HTTPFatalError < Net::ProtoFatalError 23 include Net::HTTPExceptions 24end 25 26