← Home ← Back to /g/

Thread 106470512

5 posts 2 images /g/
Anonymous No.106470512 >>106470658 >>106470788
>throwing custom Exceptions when validation fails

Do peepo still really?
Anonymous No.106470529
It just works.
Anonymous No.106470658 >>106470794
>>106470512 (OP)
Why are exceptions bad again?
Anonymous No.106470788
>>106470512 (OP)
I do this.
Anonymous No.106470794
>>106470658
They're heavyweight. That's fine if recovery isn't possible, in which case you want to capture and log as much data about what happened as possible. But if the exception is due to trying to insert a letter into integer storage, you really don't need all that overhead as the recovery pattern is to not do the insert and inform the user that they're retarded for entering crap. Also it makes it obvious to the developer that they were being lazy shits with input validation.