-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1559 from tk0miya/net-protocol
stdlib: Separate types for net-protocol from net-http module
- Loading branch information
Showing
4 changed files
with
59 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dependencies: | ||
- name: net-protocol | ||
- name: uri | ||
- name: timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dependencies: | ||
- name: timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |