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

Make error message prefixes more descriptive #11612

Merged
merged 1 commit into from Aug 27, 2022

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented May 26, 2020

Sorry for the drive-by contribution. Didn't want to forget about it. I'll look at possible CI failures later. Updated tests

I noticed when testing errors for babel macro with babel-plugin-tester that the error messages would be prefixed with unknown:. It wasn't clear to me whether this was an issue on my side with custom errors or babel-plugin-tester.

Turns out this is expected if the code does not come from an actual file. Hopefully this is less confusing for future users if we prefix it with "unknown file" instead of "unknown". It's not obvious to me that "unknown" refers to a file in the error context.

It might even make more sense to not prefix the filename and instead append the filename e.g.

Some error message from plugin X
  in /path/to/file/that/is/transformed.js
Q                       A
Fixed Issues? found none using keywords unknown error
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature? Probably
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

@babel-bot
Copy link
Collaborator

babel-bot commented May 26, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52812/

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 26, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit dc8471d:

Sandbox Source
jolly-tdd-r0ty8 Configuration
affectionate-bird-8t1sj Configuration

@nicolo-ribaudo
Copy link
Member

Related - #11554

@eps1lon eps1lon marked this pull request as ready for review May 27, 2020 08:59
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

I like this, I'll take care of rebasing once #11554 is merged.

@nicolo-ribaudo nicolo-ribaudo added PR: Polish 💅 A type of pull request used for our changelog categories area: errors labels Aug 24, 2022
@nicolo-ribaudo nicolo-ribaudo changed the title feat(core): Make error message prefixes more descriptive Make error message prefixes more descriptive Aug 27, 2022
@nicolo-ribaudo nicolo-ribaudo changed the base branch from master to main August 27, 2022 09:29
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
@nicolo-ribaudo nicolo-ribaudo merged commit cf0b1e7 into babel:main Aug 27, 2022
@eps1lon eps1lon deleted the patch-1 branch August 29, 2022 09:05
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Nov 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: errors outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: core PR: Polish 💅 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants