-
Notifications
You must be signed in to change notification settings - Fork 70
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
Overhaul thrown exceptions #191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this because it seems fine, but I did leave a couple comments for you to consider.
@agibson-godaddy sorry I went to a different direction after reading your comments but mostly re-evaluating the purpose of this PR - in the end maybe WP_Mock is already using some specific exceptions depending on context (from PhpUnit expectation failed exception, mockery exceptions, etc.). I have added a couple of |
Summary
Adds aWP_MockException
object and overhauls exceptions used or referenced within project.After consideration, I decided to go for more specific exceptions in the PHP stdlib - such as
RunTimeException
orInvalidArgumentException
when applicable. I realized that WP_Mock already uses other domain-specific exceptions when it comes to assertions failed or mockery exceptions, so perhaps at the moment we don't need a specific WP_Mock exception.Had to make additional changes due to PhpStan errors after updating code.
Closes: #189
Contributor checklist
Testing
Reviewer checklist