ueberauth / ueberauth_twitter

Twitter Strategy for Überauth
MIT License
36 stars 38 forks source link

Incorrect raising of network errors on token retrieval #8

Closed jbrowning closed 8 years ago

jbrowning commented 8 years ago

If :oauth.get/3 results in a network error it returns a tuple with error information. This results in an ArgumentError in Ueberauth.Strategy.Twitter.OAuth.request_token!/2 because Kernel.raise/1 only supports exceptions, binaries, and atoms:

raise/1 expects an alias, string or exception as the first argument, got: {:error,
{:failed_connect, [{:to_address, {'api.twitter.com', 443}}, {:inet, [:inet], :nxdomain}]}}
doomspork commented 8 years ago

Thanks for the report @jbrowning. Would you like to take a shot at fixing this?

jbrowning commented 8 years ago

Sure. I'll try to send in a PR today.