Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where should Exceptions be caught?

Tags:

oop

In designing class with multiple/nested has-a relationships, who should catch exceptions? I guess this depends on design but is there any rule of thumb?

like image 703
tvr Avatar asked Jun 25 '26 07:06

tvr


1 Answers

The rule of thumb is the one who knows better what to do with that exception should catch the exception.

like image 168
sharptooth Avatar answered Jun 27 '26 01:06

sharptooth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!