diff --git a/.changeset/sharp-bottles-agree.md b/.changeset/sharp-bottles-agree.md new file mode 100644 index 0000000000..2e669e91fb --- /dev/null +++ b/.changeset/sharp-bottles-agree.md @@ -0,0 +1,7 @@ +--- +"wrangler": patch +--- + +Improve error message when request to obtain membership info fails + +Wrangler now informs user that specific permission might be not granted when fails to obtain membership info. The same information is provided when Wrangler is unable to fetch user's email. diff --git a/packages/wrangler/src/__tests__/whoami.test.ts b/packages/wrangler/src/__tests__/whoami.test.ts index 966b378139..d56e9c3786 100644 --- a/packages/wrangler/src/__tests__/whoami.test.ts +++ b/packages/wrangler/src/__tests__/whoami.test.ts @@ -231,7 +231,7 @@ describe("whoami", () => { └───────────────┴────────────┘ 🔓 Token Permissions: If scopes are missing, you may need to logout and re-login. Scope (Access) - 🎢 Unable to get membership roles. Make sure you have permissions to read the account." + 🎢 Unable to get membership roles. Make sure you have permissions to read the account. Are you missing the \`User->Memberships->Read\` permission?" `); }); }); diff --git a/packages/wrangler/src/user/whoami.ts b/packages/wrangler/src/user/whoami.ts index d9fcf533be..ddd6f58fe8 100644 --- a/packages/wrangler/src/user/whoami.ts +++ b/packages/wrangler/src/user/whoami.ts @@ -86,7 +86,7 @@ async function printMembershipInfo(user: UserInfo, accountFilter?: string) { } catch (e) { if (isAuthenticationError(e)) { logger.log( - `🎢 Unable to get membership roles. Make sure you have permissions to read the account.` + `🎢 Unable to get membership roles. Make sure you have permissions to read the account. Are you missing the \`User->Memberships->Read\` permission?` ); return; } else {