Fr0sT.Brutal 900 Posted December 17, 2020 (edited) MyException := ESocketException.Create(MyMessage, AErrorCode, AErrorMessage, AFriendlyMsg, AFunc, AIP, APort, AProto); if Assigned (FonException) then begin TriggerException (MyException) ; { V8.36 } end else begin TriggerException (MyException) ; { V8.37 } raise MyException; end; if Assigned (MyException) then MyException.Free; { V8.37 } end; end; This fragment looks pretty weird for me 1 - TriggerException is called always so could be lifted before `if Assigned` 2 - `if Assigned (MyException)` is useless because it's created several lines earlier Wouldn't this be the shorter equivalent? MyException := ESocketException.Create(MyMessage, AErrorCode, AErrorMessage, AFriendlyMsg, AFunc, AIP, APort, AProto); TriggerException (MyException) ; { V8.36 } if not Assigned (FonException) then raise MyException; MyException.Free; { V8.37 } Edited December 17, 2020 by Fr0sT.Brutal Share this post Link to post