Skip to content

Avoid some false positive bundled gem warnings #12786

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deivid-rodriguez
Copy link
Contributor

When a bundled gem has already been removed, a require caller is rescuing LoadError, no warning/error messages should be displayed.

Instead, let the bundled gem message be part of LoadError, so that it's not displayed when rescued, but still gets to the user when not rescued.

This is an idea to reintroduce #11550, but without the issue that made @hsbt revert the original approach: If users upgrade Ruby from a version that did not show any warnings, to a version where the default gem has already been removed, then they'll miss any noticed about removal of the default gem. By making the notice part of the LoadError, they will not miss it.

This comment has been minimized.

When a bundled gem has already been removed, a `require` caller is
rescuing `LoadError`, no warning/error messages should be displayed.

Instead, let the bundled gem message be part of `LoadError`, so that
it's not displayed when rescued, but still gets to the user when not
rescued.
@deivid-rodriguez deivid-rodriguez force-pushed the optional-gems-warnings branch from c819aef to 5a7392d Compare April 8, 2025 14:19
@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review April 8, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant