8
rudilee
3y

I just don't understand why people use the try-catch on calling a method that will throw exceptions just to ONLY re-throw it again, what would you do that for? :(

Comments
  • 2
    Leftover code suppose. Only reasonable option would perhaps be a log statement
  • 5
    At least thats better than catching the exception and not doing anything to it, with the intention that the program will not work at a later point when it becomes a problem. I've seen that.
  • 2
    To get rid of IDE warnings?
  • 2
    It can be useful if the problem sucks you and requires time for research. I once used it on production when fed up reading those errorlogs and just catch err and made the variable unused :P
  • 1
    @Eklavya Then in code review I'd reckon you add a todo statement
Add Comment