Access GetMailWasSent

delphi package - automated exception handling

Access GetMailWasSent

Postby FredS » Thu Jan 09, 2020 1:11 am

Ported for clarity from viewtopic.php?f=4&t=28780#p53268

My mes file contains:
Code: Select all

There are a couple of reasons to get at GetMailWasSent, which is available in IMEExceptionEx. This is not possible without copying the interface. The solution I suggest is adding a method like 'WasMailSent'.

1) Using SendBugReport
When you send a report without the Full Exception Dialog using 'SendBugReport' the Report is Not Auto-saved on send failure.
If I use the only exposed method 'AutoSaveBugReport' then its saved regardless of the send failure.

For now, since I made source changes, I added an accessible method that can be checked :
Code: Select all
    function WasMailSent(const ime: IMEException): Boolean;
      Result := (ime  as IMEExceptionEx).GetMailWasSent;

I see no way other than copying the IMEExceptionEx interface to get access to this information.
Here is an example of sending a report without the use of an Exception Dialog:
Code: Select all
    if not madExcept.WasMailSent(exceptIntf) then
    Handled := True;

2) If mail was sent via ImportBugReport.Show
If you load a Report with 'ImportBugReport' and the user sends it during 'Show', it doesn't get automatically deleted.

In this code I need to know if the Report was Sent, and use 'WasMailSent':
Code: Select all
class procedure TMadMBR.ShowMBR(const BugReport: TFilename; SkipDialog: boolean);
var ime : IMEException;
  ime := ImportBugReport(TFile.ReadAllText(BugReport));
  ime.AutoShowBugReport := SkipDialog;
  ime.SetShowBtnVisible(not ime.AutoShowBugReport);
  ime.BugReportFile := ExtractFileName(BugReport) + '.txt';// user may want to save it to another location
  if madExcept.WasMailSent(ime) then
Posts: 97
Joined: Mon May 11, 2015 9:42 pm

Return to madExcept

Who is online

Users browsing this forum: madshi and 22 guests