Skip to content

[cli] update handleError to use output utilities#12817

Merged
erikareads merged 5 commits intomainfrom
erikarowland/update-handle-error-to-use-output
Jan 3, 2025
Merged

[cli] update handleError to use output utilities#12817
erikareads merged 5 commits intomainfrom
erikarowland/update-handle-error-to-use-output

Conversation

@erikareads
Copy link
Copy Markdown
Contributor

@erikareads erikareads commented Jan 2, 2025

Previously #12010 I created printError to begin changing the API of handleError to use output instead of directly using console.error. Since we're now importing a usable output object directly, handleError can be updated without changing its call signature. This PR moves the updates from printError into handleError and removes the now redundant printError.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 2, 2025

🦋 Changeset detected

Latest commit: 8b61233

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

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

import output from '../output-manager';

export function printError(error: unknown) {
export default function handleError(error: unknown) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we drop the default while we're at it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to do a fast-follow PR renaming handleError to printError since that better represents what the function does, since I'm going to need to change imports on that PR anyway, it'll be easier to drop default on that PR.

@erikareads erikareads enabled auto-merge January 3, 2025 00:27
@erikareads erikareads requested a review from TooTallNate January 3, 2025 00:27
@erikareads erikareads added this pull request to the merge queue Jan 3, 2025
Merged via the queue into main with commit 53f44fc Jan 3, 2025
@erikareads erikareads deleted the erikarowland/update-handle-error-to-use-output branch January 3, 2025 00:34
TooTallNate pushed a commit that referenced this pull request Jan 3, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Patch Changes

- Revert build utils refactor
([#12818](#12818))

## [email protected]

### Patch Changes

- [cli] update handleError to use output utilities
([#12817](#12817))

- Fix bug where when page doesn't postpone it still generates a correct
fallback ([#12811](#12811))

- Updated dependencies
\[[`4cb6143887f36060e9e4fa5866aa97a6af25b6ae`](4cb6143),
[`e570a1660c2b18a41d8c3985e645a175a44a5ea4`](e570a16),
[`2a59669c70b65fd01f755c8fd646e08619ebee3d`](2a59669),
[`9d6fb57d5659f1b8d38fea5ff3d54f8efb8bc5f4`](9d6fb57)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`e570a1660c2b18a41d8c3985e645a175a44a5ea4`](e570a16)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`e570a1660c2b18a41d8c3985e645a175a44a5ea4`](e570a16)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Revert build utils refactor
([#12818](#12818))

## @vercel/[email protected]

### Patch Changes

- Upgrade @vercel/nft to 0.27.10
([#12109](#12109))

- Revert build utils refactor
([#12818](#12818))

- Fix bug where when page doesn't postpone it still generates a correct
fallback ([#12811](#12811))

## @vercel/[email protected]

### Patch Changes

- Upgrade @vercel/nft to 0.27.10
([#12109](#12109))

- Updated dependencies
\[[`e570a1660c2b18a41d8c3985e645a175a44a5ea4`](e570a16)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Upgrade @vercel/nft to 0.27.10
([#12109](#12109))

- Revert build utils refactor
([#12818](#12818))

## @vercel/[email protected]

### Patch Changes

- Upgrade @vercel/nft to 0.27.10
([#12109](#12109))

- Revert build utils refactor
([#12818](#12818))

- Update `@remix-run/dev` fork to v2.15.2
([#12796](#12796))

## @vercel/[email protected]

### Patch Changes

- Revert build utils refactor
([#12818](#12818))

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`e570a1660c2b18a41d8c3985e645a175a44a5ea4`](e570a16)]:
    -   @vercel/[email protected]
github-merge-queue bot pushed a commit that referenced this pull request Jan 3, 2025
The `handleError` function doesn't handle errors, it only prints human
readable translations of those errors to users. This PR follows the
`handleError` update in #12817 and
renames `handleError` to `printError` which better represents how the
function is used.

This PR also removes the `default` export, making `printError` an
explicit import everywhere it's used.
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/[email protected]

### Patch Changes

- Revert build utils refactor
([#12818](vercel/vercel#12818))

## [email protected]

### Patch Changes

- [cli] update handleError to use output utilities
([#12817](vercel/vercel#12817))

- Fix bug where when page doesn't postpone it still generates a correct
fallback ([#12811](vercel/vercel#12811))

- Updated dependencies
\[[`7c0d843af8134b889b545f29ecfbf47601f789d0`](vercel/vercel@7c0d843),
[`7163a6331f365c345f3edb64afdbc06a2bb3571d`](vercel/vercel@7163a63),
[`e04da5eda571c676c900442579e27b250111e61a`](vercel/vercel@e04da5e),
[`7c4ef393456175e2c3e7432b64675c433950a352`](vercel/vercel@7c4ef39)]:
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`7163a6331f365c345f3edb64afdbc06a2bb3571d`](vercel/vercel@7163a63)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Updated dependencies
\[[`7163a6331f365c345f3edb64afdbc06a2bb3571d`](vercel/vercel@7163a63)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Revert build utils refactor
([#12818](vercel/vercel#12818))

## @vercel/[email protected]

### Patch Changes

- Upgrade @vercel/nft to 0.27.10
([#12109](vercel/vercel#12109))

- Revert build utils refactor
([#12818](vercel/vercel#12818))

- Fix bug where when page doesn't postpone it still generates a correct
fallback ([#12811](vercel/vercel#12811))

## @vercel/[email protected]

### Patch Changes

- Upgrade @vercel/nft to 0.27.10
([#12109](vercel/vercel#12109))

- Updated dependencies
\[[`7163a6331f365c345f3edb64afdbc06a2bb3571d`](vercel/vercel@7163a63)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Patch Changes

- Upgrade @vercel/nft to 0.27.10
([#12109](vercel/vercel#12109))

- Revert build utils refactor
([#12818](vercel/vercel#12818))

## @vercel/[email protected]

### Patch Changes

- Upgrade @vercel/nft to 0.27.10
([#12109](vercel/vercel#12109))

- Revert build utils refactor
([#12818](vercel/vercel#12818))

- Update `@remix-run/dev` fork to v2.15.2
([#12796](vercel/vercel#12796))

## @vercel/[email protected]

### Patch Changes

- Revert build utils refactor
([#12818](vercel/vercel#12818))

-   Updated dependencies \[]:
    -   @vercel/[email protected]

## @vercel-internals/[email protected]

### Patch Changes

- Updated dependencies
\[[`7163a6331f365c345f3edb64afdbc06a2bb3571d`](vercel/vercel@7163a63)]:
    -   @vercel/[email protected]
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
The `handleError` function doesn't handle errors, it only prints human
readable translations of those errors to users. This PR follows the
`handleError` update in vercel/vercel#12817 and
renames `handleError` to `printError` which better represents how the
function is used.

This PR also removes the `default` export, making `printError` an
explicit import everywhere it's used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants