Get StackTrace for Exception

delphi package - automated exception handling
Post Reply
Batteken
Posts: 65
Joined: Tue May 30, 2006 6:01 am

Get StackTrace for Exception

Post by Batteken »

Hello,

I would like to do the following:
try
{
...
some code that could generate exceptions
...
}
catch(Exception& e)
{
-> show the stacktrace that matches the exception
}

How could I do this ?

regards,
Bart
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Get StackTrace for Exception

Post by madshi »

How do you want to "show" the stack trace? MessageBox? Writing to a log?
Batteken
Posts: 65
Joined: Tue May 30, 2006 6:01 am

Re: Get StackTrace for Exception

Post by Batteken »

Write to own log file.
Batteken
Posts: 65
Joined: Tue May 30, 2006 6:01 am

Re: Get StackTrace for Exception

Post by Batteken »

So, basically, just get it as a string
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Re: Get StackTrace for Exception

Post by madshi »

Then please use "GetCrashStackTrace()" exported by madExcept.pas:

http://help.madshi.net/madExceptUnit.ht ... StackTrace
Batteken
Posts: 65
Joined: Tue May 30, 2006 6:01 am

Re: Get StackTrace for Exception

Post by Batteken »

Thx, I will try that tomorrow.
Batteken
Posts: 65
Joined: Tue May 30, 2006 6:01 am

Re: Get StackTrace for Exception

Post by Batteken »

Thanks,

It is exactly what I wanted !

regards,
Bart
Post Reply