I see no problem with raising an exception in a constructor, provided you write the destructor in a way that can handle a partly constructed instance. Since you can't prevent any system or RTL exception to be raised from within the constructor, you'll have to handle that case anyway.
Always keep in mind that an exception in a constructor will cause the destructor being called immediately.
So don't do this:
constructor TBla.Create;
begin
inherited;
FSomeHelperObject := TSomeClass.Create;
end;
destructor TBla.Destroy;
begin
FSomeHelperObject.Free; // <== this might cause an AV if FSomeHelperObject hasn't been assigend
inherited;
end;
But do this instead:
destructor TBla.Destroy;
begin
if Assigned(FSomeHelperObject) then
FSomeHelperObject.Free;
inherited;
end;
(Or use FreeAndNil, which basically does the same internally.)
You can easily test if your destructor can handle this case by temporarily putting a raise exception.Create('test') as the first statement in your constructor (before even calling inherited Create).
I'm sure we are all guilty of writing wrong destructors at some time though.