[Issue 11865] Unhandled exception does not show crash dialog

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 6 00:18:50 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11865



--- Comment #5 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-01-06 10:18:46 EET ---
(In reply to comment #3)
> Could there be a way to set a delegate that is called when there is an
> uncaught exception and have an easy way to get the exception type, name, and
> stack trace?

Yes. In fact, something like that existed in the runtime a while ago. However,
you can achieve mostly the same by writing your own WinMain as shown here:

http://dlang.org/windows.html

This page is a bit outdated. Note the exceptionHandler parameter: this is the
mechanism mentioned above that no longer works, and those overloads of
Runtime.initialize/terminate are now deprecated. (Martin Nowak removed them in
b95be7e55e57a4ff065f1dc5f3362fc476d85f4d. Before that, Walter Bright wrote in a
comment: "Note that if we get here, the runtime is in an unknown state. I'm not
sure what the point of calling dg is."). However, the general idea still works,
if you don't care about exceptions thrown during runtime initialization /
deinitialization (this includes static constructors/destructors). Just replace
the MessageBoxA call with your custom error-handling code.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list