Skip to content
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

Restyle error messages #2902

Merged
merged 3 commits into from
Mar 28, 2022
Merged

Restyle error messages #2902

merged 3 commits into from
Mar 28, 2022

Conversation

FredKSchott
Copy link
Member

Changes

  • As I was working on New Markdown API #2862 I was bothered by the Vite errors that we were exposing to Astro users.
  • This PR restyles our error messages with a fresh can of paint
  • more importantly, it sets up some handling for re-phrasing Vite error messages that we can add to going forward.

Screenshots

Build (with metadata)

Screen Shot 2022-03-26 at 3 12 43 PM

Dev (with metadata)

Screen Shot 2022-03-26 at 3 12 52 PM

Without metadata

Screen Shot 2022-03-26 at 3 15 33 PM

Testing

  • Error output tested manually

Docs

  • N/A

@changeset-bot
Copy link

changeset-bot bot commented Mar 26, 2022

🦋 Changeset detected

Latest commit: 1245654

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

This PR includes changesets to release 1 package
Name Type
astro 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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 26, 2022
@FredKSchott FredKSchott force-pushed the style-error-messages branch 5 times, most recently from eb19f31 to b8affec Compare March 27, 2022 04:55
@github-actions github-actions bot added the test label Mar 27, 2022
@FredKSchott FredKSchott force-pushed the style-error-messages branch 2 times, most recently from a9d755f to 1f1cd36 Compare March 27, 2022 05:08
@FredKSchott FredKSchott force-pushed the style-error-messages branch from 1f1cd36 to 7824c03 Compare March 27, 2022 05:22
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Clean refactors, CLI output looks great. ✅

packages/astro/src/core/build/generate.ts Outdated Show resolved Hide resolved
packages/astro/src/core/build/index.ts Show resolved Hide resolved
packages/astro/src/core/build/generate.ts Outdated Show resolved Hide resolved
const result = await callEndpoint(mod as unknown as EndpointHandler, options);

if (result.type === 'response') {
throw new Error(`Returning a Response from an endpoint is not supported in SSG mode.`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh good catch!

Copy link
Member Author

Choose a reason for hiding this comment

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

I wish I came up with this! but it was just moved from elsewhere. You probably have @matthewp to thank :)

@FredKSchott FredKSchott merged commit f702070 into main Mar 28, 2022
@FredKSchott FredKSchott deleted the style-error-messages branch March 28, 2022 23:55
@github-actions github-actions bot mentioned this pull request Mar 28, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* clean up error logging in astro

* update from ben feedback

* Update packages/astro/src/core/build/generate.ts

Co-authored-by: Ben Holmes <[email protected]>

Co-authored-by: Ben Holmes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants