From 7c323941c2981f72a60f4039dff70df77d70b885 Mon Sep 17 00:00:00 2001 From: nico piderman Date: Thu, 29 Jan 2026 16:43:46 +0100 Subject: [PATCH] declare types for Mint.HTTPError.reason() and Mint.TransportError.reason() --- lib/mint/http_error.ex | 5 ++--- lib/mint/transport_error.ex | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mint/http_error.ex b/lib/mint/http_error.ex index 4a1e2efa..3bbaf6a0 100644 --- a/lib/mint/http_error.ex +++ b/lib/mint/http_error.ex @@ -53,9 +53,8 @@ defmodule Mint.HTTPError do | {:unexpected_status, non_neg_integer()} | {:unexpected_trailing_responses, list()}} - @type t() :: %__MODULE__{ - reason: HTTP1.error_reason() | HTTP2.error_reason() | proxy_reason() | term() - } + @type reason :: HTTP1.error_reason() | HTTP2.error_reason() | proxy_reason() | term() + @type t() :: %__MODULE__{reason: reason()} defexception [:reason, :module] diff --git a/lib/mint/transport_error.ex b/lib/mint/transport_error.ex index f5694b1e..62c19dcb 100644 --- a/lib/mint/transport_error.ex +++ b/lib/mint/transport_error.ex @@ -55,7 +55,8 @@ defmodule Mint.TransportError do reason_type end - @type t() :: %__MODULE__{reason: unquote(reason_type) | term()} + @type reason :: unquote(reason_type) | term() + @type t() :: %__MODULE__{reason: reason()} defexception [:reason]