Problem RegisterExceptionHandler
Posted: Wed Nov 04, 2020 9:11 pm
Hi
I'm trying to get a complete stacktrace from a FMX client (32 and 64 bit) to our server.
I do not use the build in dialog but want to send the bug message silently to a rest server. The user will get a proper dialog message later.
The whole bug report should end up in a string.
The problem is that GetCrashStackTrace() returns nothing.
What am I doing wrong?
I hope you can help.
I'm trying to get a complete stacktrace from a FMX client (32 and 64 bit) to our server.
I do not use the build in dialog but want to send the bug message silently to a rest server. The user will get a proper dialog message later.
The whole bug report should end up in a string.
The problem is that GetCrashStackTrace() returns nothing.
What am I doing wrong?
Code: Select all
procedure HandleWindowsException(const exceptIntf: IMEException; var handled: boolean);
var i: Integer;
begin
var mainReason := 'Exception: ' + exceptIntf.ExceptMessage;
var crashStackTrace := GetCrashStackTrace();
var bugReport := CreateBugReport();
var body := mainReason + '<br/><br/>Stacktrace: ' + crashStackTrace + '<br/><br/><br/>' + bugReport;
// do stuff with body
end;
initialization
RegisterExceptionHandler(HandleWindowsException, stDontSync);
end.
I hope you can help.