Exception/Error division in D

Walter Bright newshound2 at digitalmars.com
Thu May 31 12:47:39 PDT 2012


On 5/31/2012 12:40 AM, Jens Mueller wrote:
> How do I do a graceful shutdown if finally and scope is not guaranteed
> to be executed? Assuming onAssertError, etc. is of no use because I need
> to perform different shutdowns due to having different cases or if I
> defined my own Error, let's say for some device.

There's no way to guarantee a graceful shutdown.

No way.

If you must have such, then the way to do it is to divide your application into 
separate processes that communicate via interprocess communication, then when 
one component fails the rest of your app can restart it or do what's necessary, 
as the rest is not in an invalid state.



More information about the Digitalmars-d mailing list