[Issue 8135] throwing Error runs finally handler
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu May 24 07:13:49 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8135
jens.k.mueller at gmx.de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jens.k.mueller at gmx.de
--- Comment #9 from jens.k.mueller at gmx.de 2012-05-24 07:15:30 PDT ---
I don't see why there should be no way to do some simple cleanup on an Error.
Testing in contracts is useful and does no harm. Maybe Walter can give a
concrete example where handling of Errors caused the program to be in a worse
state compared to exit right away given the programmer had a solid
understanding of what he was doing. Assuming I get an OutOfMemoryError having
chances sending last words is useful. I fail to see how this can make it worse.
It may be that he has seen to many misuses of handling errors. I would go with
a C++ attitude: "You can catch, scope guard, etc. any Throwable and even try to
recover from Exceptions. But Errors are not meant to be recovered from. You
have been warned."
TDPL also says that it's okay to do some cleanup.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list