how to tell whether we are running inside a try/catch block?

Timothee Cour thelastmammoth at gmail.com
Fri Oct 25 04:12:55 PDT 2013


is there a way to tell whether we're running inside a try/catch block, as
well as the type T expected by the catch(T) block (and perhaps also
file/line info) ?

use case:

i'd like to customize my exception handler so that if I'm not running in a
try/catch block, then I will pause instead of exiting so that I can start a
debugger at that point. Note that pause inside the catch block is not good,
as the stack would already be unwinded and there'd be no way to go back in
time to the point where the relevant exception got thrown. Further, I'd
like to customize this logic depending on the type expected by the catch
block.

I see relevant functions in src/druntime/src/rt/deh2.d but nothing is
exposed publicly.
thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20131025/2e57a13a/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list