Override assert handler

Ogi ogion.art at gmail.com
Mon Aug 19 16:31:34 UTC 2024


On Saturday, 17 August 2024 at 08:10:26 UTC, Manu wrote:
>
> Have people done this in their own programs? What is the best 
> practice?

As an option, you can just catch it:

```D
void main()
{
     import core.exception : AssertError;
     try {
         assert(true == false);
     }
     catch (AssertError e) {
         writeln("Oh no! ", e.msg);
     }
}
```



More information about the Digitalmars-d mailing list