Customizing error behavior

Sönke Ludwig sludwig at outerproduct.org
Fri Sep 12 15:42:37 UTC 2025


Is there any way to customize the behavior of the various `Error`s 
generated by Druntime? On Windows it's possible to redefine the error 
functions, such as onOutOfMemoryError or onRangeError, in your 
executable to let them override the ones defined in Druntime. However, 
on other systems that just leads to a duplicate symbol linker error.

The reason I'd like to modify the behavior is twofold:

- The output to `stderr` is lost in our setup (GUI application)
- The point of failure after an error was thrown inside of a fiber 
(vibe.d task) is not the place where it was raised, but the place where 
it was caught (at a subsequent `abort()` call)

If there is currently no way, could those symbols be changed to weak 
linkage to enable the Windows approach on other platforms?


More information about the digitalmars-d-ldc mailing list