Skip to content

Commit

Permalink
update README example
Browse files Browse the repository at this point in the history
  • Loading branch information
scrogson committed Feb 2, 2017
1 parent f82d5f1 commit 1a4e847
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ user = OAuth2.Client.get!(client, "/user").body

# Or
case OAuth2.Client.get(client, "/user") do
{:ok, %OAuth2.Response{status_code: 401, body: body}} ->
Logger.error("Unauthorized token")
{:ok, %OAuth2.Response{status_code: status_code, body: user}} when status_code in [200..399] ->
{:ok, %OAuth2.Response{body: user}} ->
user
{:error, %OAuth2.Response{status_code: 401, body: body}} ->
Logger.error("Unauthorized token")
{:error, %OAuth2.Error{reason: reason}} ->
Logger.error("Error: #{inspect reason}")
end
Expand Down

0 comments on commit 1a4e847

Please sign in to comment.