Skip to content

Commit ab56a6e

Browse files
authored
Merge pull request #2574 from ksss/open-uri-error
Add signatures for `OpenURI`
2 parents fa8bba6 + a06372f commit ab56a6e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

stdlib/open-uri/0/open-uri.rbs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,34 @@ end
8383
# : Tanaka Akira <[email protected]>
8484
#
8585
module OpenURI
86+
class HTTPError < StandardError
87+
# <!--
88+
# rdoc-file=lib/open-uri.rb
89+
# - new(message, io)
90+
# -->
91+
#
92+
def initialize: (String message, (StringIO & OpenURI::Meta) io) -> void
93+
94+
attr_reader io: StringIO & OpenURI::Meta
95+
end
96+
97+
# <!-- rdoc-file=lib/open-uri.rb -->
98+
# Raised on redirection, only occurs when `redirect` option for HTTP is `false`.
99+
#
100+
class HTTPRedirect < HTTPError
101+
# <!--
102+
# rdoc-file=lib/open-uri.rb
103+
# - new(message, io, uri)
104+
# -->
105+
#
106+
def initialize: (String message, (StringIO & OpenURI::Meta) io, URI uri) -> void
107+
108+
attr_reader uri: URI
109+
end
110+
111+
class TooManyRedirects < HTTPError
112+
end
113+
86114
# <!-- rdoc-file=lib/open-uri.rb -->
87115
# Mixin for holding meta-information.
88116
#

0 commit comments

Comments
 (0)