datagrid icon indicating copy to clipboard operation
datagrid copied to clipboard

Correct exception type

Open rixafy opened this issue 3 years ago • 3 comments

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

rixafy avatar Aug 21 '22 00:08 rixafy

I'm in. cc @paveljanda @f3l1x

radimvaculik avatar Jan 25 '23 09:01 radimvaculik

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

paveljanda avatar Jan 25 '23 09:01 paveljanda

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

image

rixafy avatar Jan 25 '23 11:01 rixafy