4 ms·
Correct, this was about swallowing errors instead of rethrowing/handling. Checked exceptions are good if you want to be sure your caller does something when th
by hyperman1 8y ago
Correct, this was about swallowing errors instead of rethrowing/handling.
Checked exceptions are good if you want to be sure your caller does something when things go south. Some examples from my experience:
* Most things that should be told to the end user, i.e. Business Exceptions. E.g. a webshop user tries to buy something but your stock has been emptied why he was deciding if he should buy or not.
* Follow-up after a modification: If you wrote half a file, you can delete it in your catch IOException instead of letting it linger around. My company has a tendency to pick up and process any file found in an output directory as soon as you release the file lock. But just not filling your disk is good enough for me as reason.