How to show Send bug report dialog

delphi package - automated exception handling

How to show Send bug report dialog

Postby kknyazev » Fri Dec 15, 2017 7:11 am

Hi! I'm trying to skip displaying Full dialog box and show Send assistant dialog, my code in custom exception wich is registered with RegisterExceptionHandler:
Code: Select all
procedure MyExceptionHandler( const exceptIntf : IMEException; var handled: boolean);
begin
...
        exceptIntf.ShowSetting := ssAssistant;
        exceptIntf.ShowAssistant := MESettings.SendAssistant;
//        exceptIntf.SendBugReport(MainForm.Handle);//   := ssAssistant;
        exceptIntf.Show
        Handled := True;
...
end;


And this code works not as default behavior, it creates email but with plain text without attachamnets of bugreport.txt and screenshort.
How can i modify my code to get standard email?
Best regards!
kknyazev
 
Posts: 8
Joined: Fri Dec 15, 2017 7:03 am

Re: How to show Send bug report dialog

Postby madshi » Fri Dec 15, 2017 9:13 am

Try removing "exceptIntf.Show" and "Handled := True". Does that help?
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to show Send bug report dialog

Postby kknyazev » Fri Dec 15, 2017 1:32 pm

Code: Select all
        exceptIntf.ShowSetting := ssAssistant;
        exceptIntf.ShowAssistant := MESettings.SendAssistant;
        Handled := False;

No mail created at all, even text
kknyazev
 
Posts: 8
Joined: Fri Dec 15, 2017 7:03 am

Re: How to show Send bug report dialog

Postby madshi » Fri Dec 15, 2017 3:08 pm

Sorry, try using "exceptIntf.SendBugReport()" + "handled := true".
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to show Send bug report dialog

Postby kknyazev » Mon Dec 18, 2017 6:12 am

No success, mail created, but with text only
kknyazev
 
Posts: 8
Joined: Fri Dec 15, 2017 7:03 am

Re: How to show Send bug report dialog

Postby madshi » Mon Dec 18, 2017 3:42 pm

If you comment out the whole exception handler, and the user then presses the "send bug report" button, do you then get the attachment and the screenshot?
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to show Send bug report dialog

Postby kknyazev » Mon Dec 18, 2017 7:13 pm

Yes, it is showed normally.
kknyazev
 
Posts: 8
Joined: Fri Dec 15, 2017 7:03 am

Re: How to show Send bug report dialog

Postby madshi » Mon Dec 18, 2017 7:30 pm

I've just tried this and it works just fine for me. Instead of using "MainForm.Handle" try using "GetDesktopWindow", just as a test. Also, in the madExcept "attachments settings" did you activate the option "capture out application only"? If so, does unchecking that option change anything?
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to show Send bug report dialog

Postby kknyazev » Tue Dec 19, 2017 5:43 am

Assistant dialog was not showed and mail was not created.
Now i register handler so:
Code: Select all
    DontHookThreads;
    RegisterExceptionHandler( AppExceptionHandler, stTrySyncCallAlways);

and process so:

  handled := True;
  try
    if MainForm <> nil then
      exceptIntf.BugReportSections.Add( 'Last SQL command info', MainForm.LastSqlCmdInfo);

    E := exceptIntf.ExceptObject as Exception;

    if IsQueryCancel(E) then Exit;

    for i := 0 to Screen.FormCount - 1 do
      if (Screen.Forms[i] is TErrorForm) and (TErrorForm(Screen.Forms[i]).ErrorMemo.text = E.Message) then
        exit;

    case TErrorForm.Exec(E) of
      mrOk: Handled := False;
      mrYes: begin
        exceptIntf.ShowSetting := ssAssistant;
        exceptIntf.ShowBugReport(GetDesktopWindow);
        Handled := True;
      end;
    end;

    if Assigned(MainForm)  then
      if IndexText( Trim(E.Message), [
           'Connection is not connected',
           'TCP Provider: An existing connection was forcibly closed by the remote host.']
         ) <> -1
      then
        MainForm.NotifyDisconnect;
  except
    handled := False;
  end;
kknyazev
 
Posts: 8
Joined: Fri Dec 15, 2017 7:03 am

Re: How to show Send bug report dialog

Postby madshi » Tue Dec 19, 2017 7:59 am

I've tried:

Code: Select all
procedure AppExceptionHandler(const exceptIntf: IMEException; var handled: boolean);
begin
  exceptIntf.SendBugReport(GetDesktopWindow);
  Handled := true;
end;

RegisterExceptionHandler(AppExceptionHandler, stDoneSync, epMainPhase);

And this works just fine for me. Can you please double check?

Also, in the madExcept "attachments settings" did you activate the option "capture out application only"? If so, does unchecking that option change anything?
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to show Send bug report dialog

Postby kknyazev » Tue Dec 19, 2017 8:57 am

Ok. I have big complex project and i will recheck on simple project. "capture out application only" is switched off
P.S. Or may be you can you send me working project for test?
Best regards
kknyazev
 
Posts: 8
Joined: Fri Dec 15, 2017 7:03 am

Re: How to show Send bug report dialog

Postby kknyazev » Tue Dec 19, 2017 9:37 am

The difference is in RegisterExceptionHandler - you use stDontSync, but i can't use it, a need VCL access. Try to change stDontSync to stTrySyncCallAlways in your test project.
kknyazev
 
Posts: 8
Joined: Fri Dec 15, 2017 7:03 am

Re: How to show Send bug report dialog

Postby madshi » Tue Dec 19, 2017 9:42 am

You've reported an issue but I can't reproduce it. I'm absolutely willing to help you, but if I'm not able to reproduce the problem, it's hard for me. So the best solution might be for you to create a little test project with which I could reproduce the issue on my PC. Then I can analyze why it's not working.
madshi
Site Admin
 
Posts: 9774
Joined: Sun Mar 21, 2004 5:25 pm

Re: How to show Send bug report dialog

Postby kknyazev » Tue Dec 19, 2017 10:38 am

Sorry, has you set stTrySyncCallAlways in handler registration?
kknyazev
 
Posts: 8
Joined: Fri Dec 15, 2017 7:03 am


Return to madExcept

Who is online

Users browsing this forum: No registered users and 4 guests