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

Switch to more semantic exception classes #82

Merged
merged 2 commits into from
Dec 22, 2022
Merged

Switch to more semantic exception classes #82

merged 2 commits into from
Dec 22, 2022

Conversation

AmraniCh
Copy link
Contributor

CHANGES

  • Exception\BadRuleSetException is now extend the InvalidArgumentException.
  • Exception\BadFixerConfigurationException is now extend the LogicException.

EXPLANATION

  • We use the BadRuleSetException exception in many situations where for ex the passed rules array is empty or contains wrong rules, or when passing an invalid fixer instance, for all those situations I see the InvalidArgumentException class is more semantic.
  • For the BadFixerConfigurationException, this exception is thrown if an invalid local config was passed with the constructor of the fixer, this should lead to a direct fix in the code and changed the passed local to valid one, so I think here extending InvalidArgumentException is more semantic and appropriate.

@AmraniCh AmraniCh changed the title change: switch to more semantic exception classes Switch to more semantic exception classes Dec 21, 2022
@lyrixx lyrixx merged commit 963b2b7 into jolicode:master Dec 22, 2022
@lyrixx
Copy link
Member

lyrixx commented Dec 22, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants