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

Add file location to errors in build #5743

Merged
merged 7 commits into from
Jan 4, 2023
Merged

Conversation

Princesseuh
Copy link
Member

Changes

Errors in build don't go through the same pipeline as in dev, as such some information was missing from errors thrown there. This doesn't add all of it, and presumably we should do this through the sourcemap eventually, but at least this now show in which file the error happened. This is only a problem for user-thrown errors, our errors already included the location as far as I could tell.

This PR additionally adds a hint to non-Error errors recommending users to instead throw Errors to get as much information as possible from their errors

Fix #5733

Testing

Added a test

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2023

🦋 Changeset detected

Latest commit: d17ba6f

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

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 Jan 4, 2023
@Princesseuh Princesseuh self-assigned this Jan 4, 2023
@Princesseuh Princesseuh merged commit 2a57864 into main Jan 4, 2023
@Princesseuh Princesseuh deleted the feat/error-location-build branch January 4, 2023 12:31
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.

Component filename missing from error message during build
2 participants