2 ms·
> Isn't swallowing (and passing) exceptions pretty much what they are for? No. You either pass them up or handle them. Silently swallowing them is a recipe for
by the_af 6y ago
> Isn't swallowing (and passing) exceptions pretty much what they are for?
No. You either pass them up or handle them. Silently swallowing them is a recipe for disaster, because nobody gets any info about what went wrong. In very limited cases -- e.g. "I don't care about this harmless error" -- it's correct to swallow them up, but Java devs tend to overuse it and disaster ensues.
> Should you instead handle every error close to their source [...]
You shouldn't. Handle those errors that it makes sense to handle, pass them up otherwise. Just don't swallow them.