Exception/Error division in D

Jens Mueller jens.k.mueller at gmx.de
Fri Jun 1 01:15:41 PDT 2012


Walter Bright wrote:
> On 5/31/2012 1:05 PM, Jens Mueller wrote:
> >Okay, let's assume I have separate processes maybe even processes on
> >different machines. In one process I get an error. Let's say I want to
> >trigger the other process that it restarts the process or just logs the
> >event whatever makes sense.
> >How do I do this if it not guaranteed that finally/scope blocks are
> >being executed?
> 
> 
> Presumably the operating system provides a means to tell when a
> process is no longer running as part of its inter-process
> communication api.

My point is that you may want to access some state of your invalid
program. State that is lost otherwise. But maybe just having the core
dump is actually enough, i.e. there is no other interesting state. You
are probably right that you can always recover from the error when a new
process is started. At least I cannot can up with a convincing case.

Since the current implementation does not follow the specification
regarding scope and finally block being executed in case of Error will
try ... catch (...Error) keep working? I have code that uses
assertThrows!AssertError to test some in contracts. Will this code
break?

Jens


More information about the Digitalmars-d mailing list