SendBugReport()

delphi package - automated exception handling
Post Reply
McManiek
Posts: 2
Joined: Mon Oct 10, 2022 7:41 am

SendBugReport()

Post by McManiek »

Is there any way to get result that bugreport was send successfully? I'm sending it via web server (own custom script).
If not possible atm. adding some callback would be nice. Thanks in advance.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: SendBugReport()

Post by madshi »

You can check the following 3 variables that are exported by madExcept:

Code: Select all

var
  LastHttpErrorNo            : dword         = 0;      // the last Http upload error number is stored here
  LastHttpErrorStr           : UnicodeString = '';     // the last Http upload error string is stored here
  LastHttpPostReply          : AnsiString    = '';     // last reply from the server when doing an HTTP post
The point in time when to check these variables may be a bit hard to find, though, because the bug report sending is often done in a background thread. But I suppose probably calling RegisterExceptActionHandler() should work, and then looking for the "eaSendBugReport3" event, which comes after the sending succeeded or failed. This will probably only work if bug report sending is done "automatically" by madExcept as part of the exception handling. If you manually call SendBugReport(), then just check those 3 variables after SendBugReport() returns.
McManiek
Posts: 2
Joined: Mon Oct 10, 2022 7:41 am

Re: SendBugReport()

Post by McManiek »

Thanks for advice. Looks like it works even if I call SendBugReport() manually (RegisterExceptActionHandler() with "stTrySyncCallAlways", then waiting for "eaSendBugReport3") but "send bug report in background" must be unchecked. Another thing is if my script returns (via header) some custom error codes (<> 200, for example 429 for too many requests), that response is handled internally (message that failed to send bugreport), theese 3 global variables mentioned above got nothing (when ExceptActionHandler was called with "eaSendBugReport3"...
Post Reply