When I use TWebSentry I do not get the exception I am trying to record:
procedure TMainData.SentryErrorProc(E: Exception; const AComment: string; var AHandled: boolean; const CallUIHandler: boolean);
var
sendException: TJSObject;
begin
sendException := TJSObject(E);
WebSentry1.CaptureException(sendException, AComment);
if CallUIHandler and Assigned(FErrorProc) then
begin
{$IFDEF RELEASE}
FErrorProc('There has been an error and the developers have been notified');
{$ELSE}
FErrorProc('Error: ' + E.Message + '. Logged at WebSentry');
{$ENDIF}
end;
end;
But the following
TypeError
Cannot read properties of undefined (reading 'hasOwnProperty')
The place it points to in the JS is
rtl.module("WEBLib.Sentry",["System","Classes","SysUtils","Web","WEBLib.Controls","JS","libsentry"],function () {..}
and the code issueing the exception
if ((hint.originalException !== null) && hint.originalException.hasOwnProperty("fHelpContext")) {
isUncaughtDelphiException = !hint.hasOwnProperty("syntheticException");
if ($Self.fEnabled) {
extraData["FromDelphi"] = "yes";
extraData["UncaughtException"] = isUncaughtDelphiException;
Sentry.captureException(hint.originalException["FJSError"],pas.JS.New(["extra",extraData]));
};
Any ideas? Thanks.