fix: replace Invalid_Experiment_Exception with _doing_it_wrong()#303
fix: replace Invalid_Experiment_Exception with _doing_it_wrong()#303
Invalid_Experiment_Exception with _doing_it_wrong()#303Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #303 +/- ##
=============================================
+ Coverage 58.03% 58.74% +0.70%
+ Complexity 576 573 -3
=============================================
Files 37 37
Lines 2955 2950 -5
=============================================
+ Hits 1715 1733 +18
+ Misses 1240 1217 -23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR removes the internal Invalid_Experiment_Exception and shifts experiment-loading error handling to use _doing_it_wrong() so invalid experiment inputs can be skipped without throwing.
Changes:
- Removed
Invalid_Experiment_Exceptionclass. - Updated
Experiment_Loader::get_default_experiments()to validate/instantiate filtered experiment entries and report failures via_doing_it_wrong().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| includes/Experiment_Loader.php | Replaces exception-based validation with _doing_it_wrong() paths when default experiment classes/instances are invalid. |
| includes/Exception/Invalid_Experiment_Exception.php | Deletes the unused exception type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
287aa90 to
e43105c
Compare
What?
This PR removes the
Invalid_Experiment_Exceptionclass and replaces it with direct calls to_doing_it_wrong().Why?
This exception was never outside facing, or triggering. Instead of needing to review or rename it for #234 we might as well remove it alltogether.
How?
Use of AI Tools
GitHub Copilot Autocomplete.
Testing Instructions
And confirm other Experiments continue to load, while a
_doing_it_wrong()about the bad class is output.Testing Instructions for Keyboard
Screenshots or screencast