Closed coryodaniel closed 5 years ago
Maybe I'm missing something, but I don't think there's a case where Goth.Token.for_scope/1
would do anything other than return {:ok, t}
or raise a MatchError
. Do you mind pointing out where the {:error, any()}
could be returned from Token.for_scope/1
?
Sorry, it should return but ends up w a mismatch on L150 below. Disable your NIC and call it.
iex(2)> Goth.Token.for_scope("https://www.googleapis.com/auth/compute https://www.googleapis.com/auth/cloud-platform")
** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :nxdomain}}
(goth) lib/goth/token.ex:150: Goth.Token.retrieve_and_store!/2
iex(2)>
Yep, been traveling, but hoping to get to this some time tomorrow.
No rush was just adding an example for my own sanity!
That looks like the fix!
Just published to Hex as v1.1.0
Goth.Token.for_scope/1
has a typespec{:ok, t}
, but I believe should be{:ok, t} | {:error, any()}
as it will return HTTPoison errors.Not the biggest of deals, but it makes downstream dialyzer a bit noisy.
Thanks for your work on this library. Its been super useful!