Add base error class to new gems. #6267
Add base error class to new gems. #6267
Conversation
Thanks for opening a pull request and helping make Bundler better! Someone from the Bundler team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use Travis CI to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of Travis CI in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #bundler channel on Slack. For more information about contributing to the Bundler project feel free to review our CONTRIBUTING guide |
Thanks for opening a PR and helping make Bundler better. I apologize for saying this after you've done all this work but i imagined this PR to just be the one line from #6267. Adding in a CLI option and adding in validation just doesn't seem necessary here. It's a simple change for the user if they want to remove or use a different error as the base class. |
Hey, no hassle—done! |
I think this looks good to go! |
@bundlerbot r+ |
📌 Commit 7482550 has been approved by |
…ndale Add base error class to new gems. Closes #6260. Room for discussion: - Which error class to use (`StandardError` makes sense to me) - What formatting to use (the three-lines-with-comment seemed nicest to me) - Whether or not using the flag to provide a different error base class is useful, and if it should validate the user's choice or not (I threw it in because it seemed harmless; is it? a boolean flag would work fine too) --- ### What was the end-user problem that led to this PR? Libraries don't always follow best practice from discussion in linked issue. ### What was your diagnosis of the problem? Bundler could encourage best practice by adding it to the gem scaffold. ### What is your fix for the problem, implemented in this PR? I added a base error class to the templates, and provided a flag to change/disable this behaviour. ### Why did you choose this fix out of the possible options? Like any best-practice-by-default, this could ruin someones workflow/go against someone's preferences so I made it as configurable as possible.
Thanks @christhekeele for the PR! |
☀️ Test successful - status-travis |
Introduced in rubygems#6267.
…ndale Add base error class to new gems. Closes #6260. Room for discussion: - Which error class to use (`StandardError` makes sense to me) - What formatting to use (the three-lines-with-comment seemed nicest to me) - Whether or not using the flag to provide a different error base class is useful, and if it should validate the user's choice or not (I threw it in because it seemed harmless; is it? a boolean flag would work fine too) --- ### What was the end-user problem that led to this PR? Libraries don't always follow best practice from discussion in linked issue. ### What was your diagnosis of the problem? Bundler could encourage best practice by adding it to the gem scaffold. ### What is your fix for the problem, implemented in this PR? I added a base error class to the templates, and provided a flag to change/disable this behaviour. ### Why did you choose this fix out of the possible options? Like any best-practice-by-default, this could ruin someones workflow/go against someone's preferences so I made it as configurable as possible. (cherry picked from commit 3aa29ce)
…ndale Add base error class to new gems. Closes #6260. Room for discussion: - Which error class to use (`StandardError` makes sense to me) - What formatting to use (the three-lines-with-comment seemed nicest to me) - Whether or not using the flag to provide a different error base class is useful, and if it should validate the user's choice or not (I threw it in because it seemed harmless; is it? a boolean flag would work fine too) --- ### What was the end-user problem that led to this PR? Libraries don't always follow best practice from discussion in linked issue. ### What was your diagnosis of the problem? Bundler could encourage best practice by adding it to the gem scaffold. ### What is your fix for the problem, implemented in this PR? I added a base error class to the templates, and provided a flag to change/disable this behaviour. ### Why did you choose this fix out of the possible options? Like any best-practice-by-default, this could ruin someones workflow/go against someone's preferences so I made it as configurable as possible. (cherry picked from commit 3aa29ce)
Closes #6260.
Room for discussion:
StandardError
makes sense to me)What was the end-user problem that led to this PR?
Libraries don't always follow best practice from discussion in linked issue.
What was your diagnosis of the problem?
Bundler could encourage best practice by adding it to the gem scaffold.
What is your fix for the problem, implemented in this PR?
I added a base error class to the templates, and provided a flag to change/disable this behaviour.
Why did you choose this fix out of the possible options?
Like any best-practice-by-default, this could ruin someones workflow/go against someone's preferences so I made it as configurable as possible.