- Notifications
You must be signed in to change notification settings - Fork 1k
Improve error logging #10734
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
Improve error logging #10734
Conversation
🦋 Changeset detectedLatest commit: 46d8a85 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
| */ | ||
| export function isAbortError(err: unknown) { | ||
| const legacyAbortErroCheck = (err as { code: string }).code !== "ABORT_ERR"; | ||
| const legacyAbortErroCheck = (err as { code: string }).code == "ABORT_ERR"; |
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.
I think this is a bug. As such, I've changed this equality check, and inverted the callsites of isAbortError(), which seems to make more sense to me.
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
| Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
e9d1bee to c36561c Compare
Fixes DEVX-2213
Previously, the
formatMessageutility was heavily used across the Wrangler codebase to nicely formatParseError-style error messages. This led to nice display, but had two problems:logger.log(formatMessage(...)), which meant that a large chunk of Wrangler's error messages were shoing up in stdout rather than stderrParseErrorwithout applying the formatting (leading to hard to understand stack traces being shown to users when e.g. a preview session failed)Now,
logger.error()will automatically applyformatMessage()when the first argument is aParseError