Skip to content

Commit 1a4e847

Browse files
committed
update README example
1 parent f82d5f1 commit 1a4e847

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ user = OAuth2.Client.get!(client, "/user").body
163163

164164
# Or
165165
case OAuth2.Client.get(client, "/user") do
166-
{:ok, %OAuth2.Response{status_code: 401, body: body}} ->
167-
Logger.error("Unauthorized token")
168-
{:ok, %OAuth2.Response{status_code: status_code, body: user}} when status_code in [200..399] ->
166+
{:ok, %OAuth2.Response{body: user}} ->
169167
user
168+
{:error, %OAuth2.Response{status_code: 401, body: body}} ->
169+
Logger.error("Unauthorized token")
170170
{:error, %OAuth2.Error{reason: reason}} ->
171171
Logger.error("Error: #{inspect reason}")
172172
end

0 commit comments

Comments
 (0)