Timeline for Is catching general exceptions really a bad thing?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 20, 2022 at 11:20 | history | edited | Glorfindel | CC BY-SA 4.0 |
broken link fixed, cf. https://meta.stackoverflow.com/a/406565/4751173
|
May 23, 2017 at 11:33 | history | edited | CommunityBot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Apr 21, 2015 at 18:33 | comment | added | supercat |
That's true, but one can (and generally should) guard finally blocks against exceptions that one can realistically expect to occur in such a way that the original and new exceptions both get logged. Unfortunately, doing that will often require memory allocation, which could cause failures of its own.
|
|
Apr 21, 2015 at 18:13 | comment | added | Martin Ba | @supercat - true enough, but that's pretty much true of any other general System exception, when stuff goes bad in any finally block. | |
Apr 21, 2015 at 18:05 | comment | added | supercat |
A major problem with OutOfMemoryException is that there's no nice way code can be sure that it "only" indicates the failure of a particular allocation one was prepared to have fail. It's possible that some other more serious exception was thrown, and an OutOfMemoryException occurred during stack unwinding from that other exception. Java may have been late to the party with its "try-with-resources", but it handles exceptions during stack unwinding a bit better than .NET.
|
|
Jan 28, 2015 at 9:29 | history | edited | Martin Ba | CC BY-SA 3.0 |
added CES / Exception Filters
|
Dec 9, 2014 at 14:37 | history | answered | Martin Ba | CC BY-SA 3.0 |