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

Throw better exception when failing to load plugin #447

Merged
merged 3 commits into from
Nov 13, 2023

Conversation

JoshuaKGoldberg
Copy link
Contributor

Fixes #446.

Please forgive me for rushing ahead, I was excited about the bugfix. 😄

@@ -68,7 +68,7 @@ describe('generate (cjs)', function () {
'cjs-main-file-does-not-exist'
);
await expect(generate(FIXTURE_PATH)).rejects.toThrow(
'Unable to determine plugin entry point.'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to construct a package.json test case to throw the existing default error... and couldn't figure it out.

Copy link
Owner

Choose a reason for hiding this comment

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

I'll try to take a look at this so we can test the old exception still.

@JoshuaKGoldberg
Copy link
Contributor Author

@bmish sorry for dropping the ball on this one - totally slipped off my task list. Looks like CI / build is an unrelated out-of-memory issue. But this should be good to review!

@bmish
Copy link
Owner

bmish commented Sep 7, 2023

@JoshuaKGoldberg no problem and sorry for the delayed review. I will see if I can add a test and get CI cleaned up (#288) in the near future so we can merge this.

@bmish bmish changed the title feat: improve error for failing to import/require from package.json Throw original exception when failing to load plugin Nov 13, 2023
@bmish bmish changed the title Throw original exception when failing to load plugin Throw better exception when failing to load plugin Nov 13, 2023
Copy link
Owner

@bmish bmish left a comment

Choose a reason for hiding this comment

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

I'm not sure how to improve the tests further, so I'm going to go ahead and merge this. Sorry again about the delay.

bmish

This comment was marked as duplicate.

@bmish bmish added the bug Something isn't working label Nov 13, 2023
@bmish bmish merged commit e133737 into bmish:main Nov 13, 2023
7 of 9 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the improve-load-package-json-error branch November 13, 2023 12:16
@JoshuaKGoldberg
Copy link
Contributor Author

Woohoo! I'm just happy it's in, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poor error message for package.json exports pointing to non-existent path
2 participants