RFC: Change what assert does on error

Dennis dkorpel at gmail.com
Fri Jul 4 19:42:04 UTC 2025


On Friday, 4 July 2025 at 18:49:50 UTC, Timon Gehr wrote:
> With: It writes a file with the full interaction log that leads 
> to the crash. The user can see the stack trace in a console 
> window that is kept open using `system("pause")`.
> (...)
> Without: The program randomly closes on the user's machine and 
> I get no further information.

Correct me if I'm wrong, but this is responding to the opening 
question of `throw AssertError` vs `printBacktrace; exit(-1);` 
right? Rikki's and Jonathan's current proposition is that 
`finally` blocks must still always be executed when an `Error` 
bubbles up through a `nothrow` function, for better error 
logging. Your custom assert handler is nice, but would work just 
as well when a couple of destructors are skipped as far as I can 
tell.


More information about the Digitalmars-d mailing list