Exception/Error division in D

deadalnix deadalnix at gmail.com
Fri Jun 1 05:03:15 PDT 2012


Le 01/06/2012 12:29, Walter Bright a écrit :
> On 6/1/2012 1:15 AM, Jens Mueller wrote:
>> 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?
>
> No. The reason for this is the implementation was not updated after the
> split between Error and Exception happened. It was overlooked.
>
>> I have code that uses
>> assertThrows!AssertError to test some in contracts. Will this code
>> break?
>
> I don't know exactly what your code is, but if you're relying on scope
> to unwind in the presence of Errors, that will break.
>

If you have an error, it is already broken in some way.

But this is unreasonable to think that the whole program is broken, 
except in very specific cases (stack corruption for instance) but in 
such a case, you can't throw an error anyway.


More information about the Digitalmars-d mailing list