Repository navigation
Improve error logging - #10734
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 |
| @@ -7,7 +7,7 @@ | |||
| * https://developer.mozilla.org/en-US/docs/Web/API/DOMException#aborterror | |||
| */ | |||
| 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.
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