Exception with ImportBugReport

delphi package - automated exception handling

Exception with ImportBugReport

Postby FredS » Sun Jan 05, 2020 6:29 pm

The installer is labeled: madCollection 2.8.8.4 (Except 5.0) Beta
MadExcept.pas shows: 2018-11-29 5.0.0

Simple Demo, all it does is raise an Exception then attempts to send but fails and is set to auto save the report.

Code: Select all
procedure TForm4.btRaiseClick(Sender: TObject);
begin
  raise Exception.Create('Error Message');
end;

procedure TForm4.btShowClick(Sender: TObject);
const bugreport = 'bugreport.txt';
begin
  Memo1.Lines.LoadFromFile(bugreport);
  with ImportBugReport(bugreport) do
  begin
    AutoShowBugReport := True;
    Show;
  end;
end;


Show loads the saved bug report into a Memo to assure it exists then ImportBugReport raises this because FProgressAlert=nil:

Code: Select all
Project Project1.exe raised exception class $C0000005 with message 'c0000005 ACCESS_VIOLATION'.
15453             FProgressAlert.AddArea((st - sb) * 100, GetPleaseWaitText);

Callstack:
Code: Select all
madExcept.GetThreadStack(4336,False,False,False,False,nil,Pointer(nil) as IProgressAlert,'',nil,0,'','')
madExcept.PrepareThreadReport
madExcept.TIMEException.GetBugReportSections
madExcept.TExceptionBox.CheckTabs
madExcept.TExceptionBox.Create(Pointer($1788050) as IMEException,False,False,True)
madExcept.ShowExceptBox(ssFullBox,True)
madExcept.ShowException(Pointer($1788050) as IMEException)
madExcept.TIMEException.Show
Unit4.TForm4.btShowClick($1778130)
FredS
 
Posts: 97
Joined: Mon May 11, 2015 9:42 pm

Re: Exception with ImportBugReport

Postby FredS » Sun Jan 05, 2020 6:36 pm

I should add that when executed without Debugger an exceptions is shown but not the saved one but the one generated by the above exception:

Code: Select all
date/time          : 2020-01-05, 10:34:12, 516ms
operating system   : Windows 10 x64 build 18362
system language    : English
system up time     : 2 days 18 hours
program up time    : 2 seconds
processors         : 4x Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
physical memory    : 6760/12196 MB (free/total)
free disk space    : (C:) 92.56 GB (D:) 45.43 GB
display mode       : 1920x1080, 32 bit
process id         : $17a4
allocated memory   : 40.23 MB
largest free block : 122839.96 GB
executable         : Project1.exe
exec. date/time    : 2020-01-05 10:31
version            : 1.0.0.0
compiled with      : Delphi 10.1 Berlin
madExcept version  : 5.0.0
callstack crc      : will be calculated soon
exception number   : 1
exception class    : Unknown
exception message  : Unknown.

thread $0:
>> stack not accessible, exception location:
00000000 +ffffffffffbb0370 Project1.exe madStackTrace 589 +3 StackAddrToStr

main thread ($c54):
>> internal error

thread $2aa8:
>> internal error

thread $22e4:
>> internal error

thread $24cc:
>> internal error

thread $2fb8:
>> internal error

thread $1fb4:
>> internal error

thread $29e8:
>> internal error

modules:
>> will be calculated soon

processes:
>> will be calculated soon

hardware:
>> will be calculated soon

disassembling:
>> will be calculated soon
FredS
 
Posts: 97
Joined: Mon May 11, 2015 9:42 pm

Re: Exception with ImportBugReport

Postby madshi » Wed Jan 08, 2020 3:19 pm

ImportBugReport wants to have the contents of the bug report, not a file name. Try using "with ImportBugReport(Memo1.Lines.Text) do".

I've modified my code now, though, to prevent the crash that currently happens if you feed ImportBugReport with an improper bug report text.
madshi
Site Admin
 
Posts: 10232
Joined: Sun Mar 21, 2004 5:25 pm

Re: Exception with ImportBugReport

Postby FredS » Wed Jan 08, 2020 9:58 pm

madshi wrote:ImportBugReport wants to have the contents of the bug report, not a file name. Try using "with ImportBugReport(Memo1.Lines.Text) do".

I've modified my code now, though, to prevent the crash that currently happens if you feed ImportBugReport with an improper bug report text.


That was an easy fix :D

thanks
FredS
 
Posts: 97
Joined: Mon May 11, 2015 9:42 pm


Return to madExcept

Who is online

Users browsing this forum: Google [Bot] and 12 guests

cron