RFC: Change what assert does on error
Dukc
ajieskola at gmail.com
Mon Jul 7 21:17:57 UTC 2025
On Sunday, 29 June 2025 at 18:04:51 UTC, Richard (Rikki) Andrew
Cattermole wrote:
> Should an assert fail, the most desirable behaviour for it to
> have is to print a backtrace if possible and then immediately
> kill the process.
No, this breaks code a bit too hard as written by many.
I think that ideally, when you wait for or poll a message from a
thread (or fiber) that has exited with an unrecoverable error,
that error would get rethrown from the waiting point. That way,
unless the error is handled every thread would eventually get
killed.
Now this wouldn't exit the failed program very quickly, but at
least it would exit it and preserve the stack trace and
possibility to catch the error.
More information about the Digitalmars-d
mailing list