Skip to content

[DOC] Get rid of a RDoc bug #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions lib/net/http/exceptions.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
# frozen_string_literal: false
# Net::HTTP exception class.
# You cannot use Net::HTTPExceptions directly; instead, you must use
# its subclasses.
module Net::HTTPExceptions
def initialize(msg, res) #:nodoc:
super msg
@response = res
module Net
# Net::HTTP exception class.
# You cannot use Net::HTTPExceptions directly; instead, you must use
# its subclasses.
module HTTPExceptions
def initialize(msg, res) #:nodoc:
super msg
@response = res
end
attr_reader :response
alias data response #:nodoc: obsolete
end
attr_reader :response
alias data response #:nodoc: obsolete
end
class Net::HTTPError < Net::ProtocolError
include Net::HTTPExceptions
end
class Net::HTTPRetriableError < Net::ProtoRetriableError
include Net::HTTPExceptions
end
class Net::HTTPClientException < Net::ProtoServerError
include Net::HTTPExceptions
end

# for compatibility
Net::HTTPServerException = Net::HTTPClientException # :nodoc:
# We cannot use the name "HTTPServerError", it is the name of the response.
class HTTPError < ProtocolError
include HTTPExceptions
end

class Net::HTTPFatalError < Net::ProtoFatalError
include Net::HTTPExceptions
end
class HTTPRetriableError < ProtoRetriableError
include HTTPExceptions
end

module Net
class HTTPClientException < ProtoServerError
include HTTPExceptions
end

class HTTPFatalError < ProtoFatalError
include HTTPExceptions
end

# We cannot use the name "HTTPServerError", it is the name of the response.
HTTPServerException = HTTPClientException # :nodoc:
deprecate_constant(:HTTPServerException)
end
Loading