You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I throw an exception in the auto_size function, using the procedure TColumn.Auto_Size; begin raise Exception.Create('Test error'); end
An error is raised and the script terminates correctly. TypeError: "auto_size" called with invalid arguments. Error: Test error
If the error is raised in SetHeaderName, it will not be displayed, the script will terminate incorrectly and a memory leak will occur. procedure TColumn.SetHeaderName(const Value: String); begin raise Exception.Create('Test error'); end
function SetRttiProperty(const ParentAddr: Pointer; Prop: TRttiProperty;
Value: PPyObject; PyDelphiWrapper: TPyDelphiWrapper;
out ErrMsg: string): Boolean;
var
AttrValue: TValue;
begin
Result := False;
try
if Ord(Prop.Visibility) < Ord(mvPublic) then
ErrMsg := rs_NoAccess
else if not Prop.IsWritable then
ErrMsg := rs_NotWritable
else if Prop.PropertyType = nil then
ErrMsg := rs_ErrNoTypeInfo
else if Prop.PropertyType.TypeKind = tkMethod then
begin
if (Prop is TRttiInstanceProperty) and (Prop.Visibility = mvPublished) then
Result := PyDelphiWrapper.EventHandlers.Link(TObject(ParentAddr),
(Prop as TRttiInstanceProperty).PropInfo, Value, ErrMsg)
else
ErrMsg := rs_NotPublished;
end
else if PyObjectToTValue(Value, Prop.PropertyType, AttrValue, ErrMsg) then
begin
Prop.SetValue(ParentAddr, AttrValue);
Result := True;
end;
except
on E: Exception do begin
ErrMsg := E.Message;
end;
end;
end;
AttributeError: Error in setting property header_name Error: Test error
The text was updated successfully, but these errors were encountered:
Hello,
I have an example like this:
If I throw an exception in the auto_size function, using the
procedure TColumn.Auto_Size; begin raise Exception.Create('Test error'); end
An error is raised and the script terminates correctly.
TypeError: "auto_size" called with invalid arguments. Error: Test error
If the error is raised in SetHeaderName, it will not be displayed, the script will terminate incorrectly and a memory leak will occur.
procedure TColumn.SetHeaderName(const Value: String); begin raise Exception.Create('Test error'); end
This modification solves the problem.
python4delphi/Source/WrapDelphi.pas
Line 3240 in 46e0bf7
try
end;
AttributeError: Error in setting property header_name Error: Test error
The text was updated successfully, but these errors were encountered: