AutoSendBugReport

delphi package - automated exception handling

AutoSendBugReport

Postby Han312 » Fri Feb 02, 2018 3:08 pm

I am trying to send a bug report within of a try..except block

Code: Select all
try
..
except
  begin
    s := GetCrashStackTrace();
    madExcept.SendBugReport( s, nil );
  end;


But that bug report does not look like the default 'bugreport.txt' which I would get when I don't handle the exception.
How can I change that?
Han312
 
Posts: 33
Joined: Mon Mar 14, 2016 3:49 pm

Re: AutoSendBugReport

Postby madshi » Fri Feb 02, 2018 3:54 pm

"GetCrashStackTrace" just gives you the stack trace, not the full bug report. If you want the full bug report, use "CreateBugReport(etNormal)".
madshi
Site Admin
 
Posts: 9880
Joined: Sun Mar 21, 2004 5:25 pm

Re: AutoSendBugReport

Postby Han312 » Tue Feb 06, 2018 10:02 am

Thanks!
Still one small problem.

On http://help.madshi.net/HowToUseMadExcept.htm you write how to adjust the header settings.

I do that

Code: Select all
initialization
  RegisterExceptionHandler(RemoveCommandLineHeaderInfo, stDontSync, epMainPhase);


but CreateBugReport(etNormal) seems to ignore it.
Han312
 
Posts: 33
Joined: Mon Mar 14, 2016 3:49 pm

Re: AutoSendBugReport

Postby madshi » Tue Feb 06, 2018 10:10 am

Yes, your exception handler is only called for true exceptions, not when you call CreateBugReport() manually. As a solution, you can either manually parse the CreateBugReport() output to remove the information you want removed. Or alternatively you can use "NewException(etNormal)" to create an exception object/interface instance. Something like this:

Code: Select all
try
  ..
except
  with NewException(etNormal) do
  begin
    BugReportHeader['command line'] := '';
    s := BugReport();
  end;
  madExcept.SendBugReport(s, nil);
end;
madshi
Site Admin
 
Posts: 9880
Joined: Sun Mar 21, 2004 5:25 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 7 guests