Catching Errors

Jack Stouffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Jan 19 07:46:04 PST 2017


On Thursday, 19 January 2017 at 15:43:26 UTC, Jacob Carlborg 
wrote:
> On 2017-01-19 15:29, Jack Stouffer wrote:
>
>> If this is the case, would it not make sense to make it 
>> illegal to catch
>> Errors in @safe code?
>
> There's the issue with AssertError, which is useful for a unit 
> test framework to catch. Perhaps it could throw an 
> AssertException instead when the "unittest" flag is passed.

Or, you can mark that unit test block as @system and have @safe 
tests in another block.


More information about the Digitalmars-d mailing list