Modifying Bug report message generated by MadExcept

431 Views Asked by At

The bug report generated by MadExcept shows computer name and other such details which is a security concern. How can I modify the message and remove such values from it.

1

There are 1 best solutions below

2
On

In your madExcept exception handler, you have access to the bug report header fields. A madExcept exception handler looks like this:

procedure ExceptionHandler(const exceptIntf: IMEException; var handled: boolean);

You can remove fields from the bug report header by operating on the supplied exceptIntf interface.

For instance define this helper function:

procedure RemoveField(const Fields: IMEFields; const FieldName: UnicodeString);
var 
  Index: Integer;
begin
  Index := exc.BugReportHeader.FindItem('computer name');
  if Index<>-1 then 
    Fields.Delete(Index);
end;

Then call it from inside your exception handler like this:

RemoveField(exceptIntf.BugReportHeader, 'computer name');