Skip to content

Commit 6b7e644

Browse files
committed
fix: Fix function spec for Response.decode/2
The input type for `GoogleApi.Gax.Response.decode/2` was missing the error case (which is explicitly handled in the first function clause). The return type incorrectly specifies that the error type must be a `Tesla.Env.t()` when in fact it may return any type (for example `:timeout` is returned when the Mint HTTP client times out).
1 parent 079a3c8 commit 6b7e644

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clients/gax/lib/google_api/gax/response.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ defmodule GoogleApi.Gax.Response do
3333
## Returns
3434
3535
* `{:ok, struct()}` on success
36-
* `{:error, Tesla.Env.t}` on failure
36+
* `{:error, any()}` on failure
3737
"""
38-
@spec decode({:ok, Tesla.Env.t()}, keyword()) :: {:ok, struct()} | {:error, Tesla.Env.t()}
38+
@spec decode({:ok, Tesla.Env.t()} | {:error, any()}, keyword()) :: {:ok, struct()} | {:error, any()}
3939
def decode(env, opts \\ [])
4040

4141
def decode({:error, reason}, _), do: {:error, reason}

0 commit comments

Comments
 (0)