[fpc-devel] EInOutError constructor
Bart
bartjunk64 at gmail.com
Wed Jul 1 14:30:16 CEST 2026
Hi,
EInOutError has a public property ErrorCode: Integer.
There is however no constructor overload that lets you set ErrorCode,
so that one could do:
raise EInOutError.Create('Message, Code).
So, now you have to do something like:
E:=EInOutError.Create(SCannotCreateEmptyDir);
E.ErrorCode:=3;
Raise E;
Setting ErrorCode is nice for applications that want to show their own
errormessages in reaction to an EInOutError exception, so you don't
have to rely on the Message part to know what went wrong.
I noticed that EVariantError indeed has a constructor that llows to
set it's ErrCode field in the constructor.
Would a feature request for such a constructor overlaod for
EInOutError be considered as possibly viable?
(If at all possible I'ld like to overload the CreateFmt() versions as well.)
--
Bart
More information about the fpc-devel
mailing list