On Sunday, 5 October 2014 at 12:36:30 UTC, ketmar via
Digitalmars-d wrote:
On Sun, 05 Oct 2014 11:28:59 +0000
monarch_dodra via Digitalmars-d <digitalmars-d@puremagic.com>
wrote:
In theory, you should seldom ever catch Errors. I don't
understand why "scope(exit)" are catching them.
'cause scope(exit) keeps the promise to execute cleanup code
before
exiting code block?
Promises hold provided the precondition your program is in a
valid state. Having an Error invalidates that precondition, hence
voids that promise.
RAII also makes the promise, but you don't see Errors giving much
of a fuck about that.