Exception/Error division in D

Walter Bright newshound2 at digitalmars.com
Thu May 31 12:44:27 PDT 2012


On 5/31/2012 2:06 AM, deadalnix wrote:
> A failure in database component should prevent me from close a network
> connection properly in an unrelated part of the program.

It *is* related if the process space is shared. The correct way to do what 
you're proposing is to make each component a separate process. Then, you are 
guaranteed that the failure of one component is separable, and restartable.


> This is called failing gracefully. And this highly recommended, and you KNOW
> that the system will fail at some point.

In a shared memory space, you have no guarantees whatsoever that the failure in 
the component is not a failure in the rest of the program. You cannot tell if it 
is related or not.


More information about the Digitalmars-d mailing list