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

Correct exception type #1042

Open
Rixafy opened this issue Aug 21, 2022 · 3 comments
Open

Correct exception type #1042

Rixafy opened this issue Aug 21, 2022 · 3 comments

Comments

@Rixafy
Copy link
Contributor

Rixafy commented Aug 21, 2022

Hi, shouldn't \Ublaboo\DataGrid\Exception\DataGridException extend \LogicException instead of \Exception?

Because I don't want to propagate nor catch those exceptions, they appear to be in methods like setSortable or setRenderer and my IDE (PhpStorm) is always reporting there is exception that is not handled, but those kind of exceptions are logic exceptions, only if there is a serious bug caused by code, the exceptions should be thrown, and there is no reason to catch them, only avoid them.

image

@radimvaculik
Copy link
Member

I'm in. cc @paveljanda @f3l1x

@paveljanda
Copy link
Member

It is a good idea. But sadly, not all those exception are Logic. Some could be Runtime.

@Rixafy
Copy link
Contributor Author

Rixafy commented Jan 25, 2023

@paveljanda that's cool, because runtime exception is also ignored by default in phpstorm

image

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

No branches or pull requests

3 participants