Skip to content

Commit 0bfcc86

Browse files
committed
Add a couple of @typedocs
1 parent 905e8e5 commit 0bfcc86

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/mint/http_error.ex

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

56+
@typedoc """
57+
The error reason.
58+
"""
59+
@typedoc since: "1.7.2"
5660
@type reason :: HTTP1.error_reason() | HTTP2.error_reason() | proxy_reason() | term()
61+
62+
@typedoc """
63+
Type for the `Mint.HTTPError` exception struct.
64+
"""
5765
@type t() :: %__MODULE__{reason: reason()}
5866

5967
defexception [:reason, :module]
6068

69+
@impl true
6170
def message(%__MODULE__{reason: reason, module: module}) do
6271
module.format_error(reason)
6372
end

lib/mint/transport_error.ex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,20 @@ defmodule Mint.TransportError do
5555
reason_type
5656
end
5757

58+
@typedoc """
59+
The error reason.
60+
"""
61+
@typedoc since: "1.7.2"
5862
@type reason :: unquote(reason_type) | term()
63+
64+
@typedoc """
65+
Type for the `Mint.TransportError` exception struct.
66+
"""
5967
@type t() :: %__MODULE__{reason: reason()}
6068

6169
defexception [:reason]
6270

71+
@impl true
6372
def message(%__MODULE__{reason: reason}) do
6473
format_reason(reason)
6574
end

0 commit comments

Comments
 (0)