Skip to content

Commit 905e8e5

Browse files
authored
Add t:Mint.HTTPError.reason/0 and t:Mint.TransportError.reason/0 (#476)
1 parent 98d4460 commit 905e8e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/mint/http_error.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ defmodule Mint.HTTPError do
5353
| {:unexpected_status, non_neg_integer()}
5454
| {:unexpected_trailing_responses, list()}}
5555

56-
@type t() :: %__MODULE__{
57-
reason: HTTP1.error_reason() | HTTP2.error_reason() | proxy_reason() | term()
58-
}
56+
@type reason :: HTTP1.error_reason() | HTTP2.error_reason() | proxy_reason() | term()
57+
@type t() :: %__MODULE__{reason: reason()}
5958

6059
defexception [:reason, :module]
6160

lib/mint/transport_error.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ defmodule Mint.TransportError do
5555
reason_type
5656
end
5757

58-
@type t() :: %__MODULE__{reason: unquote(reason_type) | term()}
58+
@type reason :: unquote(reason_type) | term()
59+
@type t() :: %__MODULE__{reason: reason()}
5960

6061
defexception [:reason]
6162

0 commit comments

Comments
 (0)