I have the following function that raises an exception:
procedure Test();
var
WinHttpReq: Variant;
begin
WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
try
WinHttpReq.Open('POST', 'https://tv.eurosport.com/', False);
WinHttpReq.SetRequestHeader('Content-Type', 'application/json');
WinHttpReq.Send('');
except
MsgBox(GetExceptionMessage, mbError, MB_OK);
end;
end;
Instead obtaining the error in a string GetExceptionMessage
, I would like to obtain the error as an integer.
Is this possible?