On 6/11/13 3:36 PM, Lars T. Kyllingstad wrote:
On Tuesday, 11 June 2013 at 18:38:51 UTC, Andrei Alexandrescu wrote:
On 6/11/13 1:01 PM, Lars T. Kyllingstad wrote:
As in a module destructor? Isn't it better to let the error pass
silently rather than throwing an exception that can't be caught?

It will not be caught but will cause the entire program to print a
diagnostic and exit with a nonzero error code, which is useful.

Then we should also provide a hook so the user has the option of
handling it. For example, core.exception could provide

void setStaticDestructorExceptionHandler(
void function(string module, Throwable t) handler);

or similar.

That's nice but but seems overdesign. I'd say let's fix the bug for now.

Andrei

Reply via email to