+ Exception.GetBaseException

This commit is contained in:
florian 2021-11-23 23:01:06 +01:00
parent b0459a19f4
commit 18e0979379
2 changed files with 18 additions and 3 deletions

View File

@ -121,6 +121,8 @@ type
AHelpContext: Longint); AHelpContext: Longint);
Function ToString : String; override; Function ToString : String; override;
function GetBaseException : Exception;virtual;
property HelpContext : longint read fhelpcontext write fhelpcontext; property HelpContext : longint read fhelpcontext write fhelpcontext;
property Message : string read fmessage write fmessage; property Message : string read fmessage write fmessage;
end; end;

View File

@ -254,6 +254,19 @@ end;
end; end;
function Exception.GetBaseException : Exception;
var
_ExceptObjectStack : PExceptObject;
begin
_ExceptObjectStack:=RaiseList;
While Assigned(_ExceptObjectStack) do
begin
result:=Exception(_ExceptObjectStack^.FObject);
_ExceptObjectStack:=_ExceptObjectStack^.Next;
end;
end;
Constructor EVariantError.CreateCode (Code : longint); Constructor EVariantError.CreateCode (Code : longint);
begin begin
case Code of case Code of