-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log token info after authentication errors #3926
Conversation
🦋 Changeset detectedLatest commit: 0500db9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6248198321/npm-package-wrangler-3926 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6248198321/npm-package-wrangler-3926 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6248198321/npm-package-wrangler-3926 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6248198321/npm-package-cloudflare-pages-shared-3926 Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
Codecov Report
@@ Coverage Diff @@
## main #3926 +/- ##
==========================================
- Coverage 75.10% 75.01% -0.09%
==========================================
Files 195 196 +1
Lines 11487 11608 +121
Branches 3036 3045 +9
==========================================
+ Hits 8627 8708 +81
- Misses 2860 2900 +40
|
@@ -721,6 +722,9 @@ export async function main(argv: string[]): Promise<void> { | |||
// The workaround is to re-run the parsing with an additional `--help` flag, which will result in the correct help message being displayed. | |||
// The `wrangler` object is "frozen"; we cannot reuse that with different args, so we must create a new CLI parser to generate the help message. | |||
await createCLIParser([...argv, "--help"]).parse(); | |||
} else if (isAuthenticationError(e)) { | |||
logger.log(formatMessage(e)); | |||
await whoami(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return or throw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's thrown at the end of this function
* Fix #1197 * Add changeset * tests
Fixes #1197.
What this PR solves / how to test:
After the API returns an authentication error, log the token info returned by
whoami()
, to help the user diagnose the issue.Associated docs issue(s)/PR(s):
Author has included the following, where applicable:
[ ] TestsReviewer is to perform the following, as applicable:
Note for PR author:
We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label
highlight pr review
so future reviewers can take inspiration and learn from it.