Skip to content

Commit

Permalink
polish: don't log all errors when logging in (#789)
Browse files Browse the repository at this point in the history
This removes a couple of logs we had for literally every error in our oauth flow. We throw the error and handle it separately anyway, so this is a safe cleanup.

Fixes #788
  • Loading branch information
threepointone committed Apr 13, 2022
1 parent a5729b0 commit 5852bba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
9 changes: 9 additions & 0 deletions .changeset/gentle-cats-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"wrangler": patch
---

polish: don't log all errors when logging in

This removes a couple of logs we had for literally every error in our oauth flow. We throw the error and handle it separately anyway, so this is a safe cleanup.

Fixes https://github.com/cloudflare/wrangler2/issues/788
12 changes: 0 additions & 12 deletions packages/wrangler/src/user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -699,18 +699,6 @@ async function exchangeRefreshTokenForAccessToken(): Promise<AccessContext> {
};
return accessContext;
} catch (error) {
switch (error) {
case "invalid_grant":
console.warn(
"Expired! Auth code or refresh token needs to be renewed."
);
// alert("Redirecting to auth server to obtain a new auth grant code.");
// TODO: return refreshAuthCodeOrRefreshToken();
break;
default:
console.error(error);
break;
}
if (typeof error === "string") {
throw toErrorClass(error);
} else {
Expand Down

0 comments on commit 5852bba

Please sign in to comment.