Skip to content

Commit

Permalink
Merge pull request #1559 from tk0miya/net-protocol
Browse files Browse the repository at this point in the history
stdlib: Separate types for net-protocol from net-http module
  • Loading branch information
soutaro authored Oct 30, 2023
2 parents 4812edc + 7aae51c commit a4993be
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 50 deletions.
2 changes: 1 addition & 1 deletion stdlib/net-http/0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dependencies:
- name: net-protocol
- name: uri
- name: timeout
49 changes: 0 additions & 49 deletions stdlib/net-http/0/net-http.rbs
Original file line number Diff line number Diff line change
@@ -1,59 +1,10 @@
module Net
class Protocol
VERSION: String
end

class ProtocolError < StandardError
end

class ProtoSyntaxError < ProtocolError
end

class ProtoFatalError < ProtocolError
end

class ProtoUnknownError < ProtocolError
end

class ProtoServerError < ProtocolError
end

class ProtoAuthError < ProtocolError
end

class ProtoCommandError < ProtocolError
end

class ProtoRetriableError < ProtocolError
end

class HTTPBadResponse < StandardError
end

class HTTPHeaderSyntaxError < StandardError
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# OpenTimeout, a subclass of Timeout::Error, is raised if a connection cannot be
# created within the open_timeout.
#
class OpenTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# ReadTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be read within the read_timeout.
#
class ReadTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# WriteTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be written within the write_timeout. Not raised on Windows.
#
class WriteTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/http.rb -->
# Class Net::HTTP provides a rich library that implements the client in a
# client-server model that uses the HTTP request-response protocol. For
Expand Down
2 changes: 2 additions & 0 deletions stdlib/net-protocol/0/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- name: timeout
56 changes: 56 additions & 0 deletions stdlib/net-protocol/0/net-protocol.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module Net
class Protocol
VERSION: String
end

class ProtocolError < StandardError
end

class ProtoSyntaxError < ProtocolError
end

class ProtoFatalError < ProtocolError
end

class ProtoUnknownError < ProtocolError
end

class ProtoServerError < ProtocolError
end

class ProtoAuthError < ProtocolError
end

class ProtoCommandError < ProtocolError
end

class ProtoRetriableError < ProtocolError
end

class HTTPBadResponse < StandardError
end

class HTTPHeaderSyntaxError < StandardError
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# OpenTimeout, a subclass of Timeout::Error, is raised if a connection cannot be
# created within the open_timeout.
#
class OpenTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# ReadTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be read within the read_timeout.
#
class ReadTimeout < Timeout::Error
end

# <!-- rdoc-file=lib/net/protocol.rb -->
# WriteTimeout, a subclass of Timeout::Error, is raised if a chunk of the
# response cannot be written within the write_timeout. Not raised on Windows.
#
class WriteTimeout < Timeout::Error
end
end

0 comments on commit a4993be

Please sign in to comment.