Get StackTrace for Exception

delphi package - automated exception handling

Get StackTrace for Exception

Postby Batteken » Mon Apr 10, 2017 2:48 pm

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
Batteken
 
Posts: 55
Joined: Tue May 30, 2006 6:01 am

Re: Get StackTrace for Exception

Postby madshi » Mon Apr 10, 2017 2:55 pm

How do you want to "show" the stack trace? MessageBox? Writing to a log?
madshi
Site Admin
 
Posts: 9414
Joined: Sun Mar 21, 2004 5:25 pm

Re: Get StackTrace for Exception

Postby Batteken » Mon Apr 10, 2017 3:27 pm

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

Re: Get StackTrace for Exception

Postby Batteken » Mon Apr 10, 2017 3:28 pm

So, basically, just get it as a string
Batteken
 
Posts: 55
Joined: Tue May 30, 2006 6:01 am

Re: Get StackTrace for Exception

Postby madshi » Mon Apr 10, 2017 3:50 pm

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

http://help.madshi.net/madExceptUnit.ht ... StackTrace
madshi
Site Admin
 
Posts: 9414
Joined: Sun Mar 21, 2004 5:25 pm

Re: Get StackTrace for Exception

Postby Batteken » Mon Apr 10, 2017 7:43 pm

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

Re: Get StackTrace for Exception

Postby Batteken » Tue Apr 11, 2017 9:30 am

Thanks,

It is exactly what I wanted !

regards,
Bart
Batteken
 
Posts: 55
Joined: Tue May 30, 2006 6:01 am


Return to madExcept

Who is online

Users browsing this forum: No registered users and 4 guests

cron