[Lazarus] Unknown error codes.

Carlos E. R. robin.listas at telefonica.net
Tue May 1 12:57:28 CEST 2018


On 2018-05-01 10:48, Rik van Kekem via Lazarus wrote:
> 
> Small test-program will give you a list:
> var
>   I: Integer;
> begin
>   for I := 0 to 99 do
>   begin
>     Memo1.Lines.Add(Format('%d - %s', [I, SysErrorMessage(I)]));
>   end;

In fact, it also prints errors beyond 100:

program errormessages;
uses
   sysutils;

var
    I: Integer;
begin
   for I := 0 to 200 do
   begin
      Writeln(I, ': ', SysErrorMessage(I));
   end;
end.

...
99: Cannot assign requested address
100: Network is down
101: Network is unreachable
102: Network dropped connection because of reset
103: Software caused connection abort
104: Connection reset by peer
105: No buffer space available
106: Transport endpoint is already connected
107: Transport endpoint is not connected
108: Cannot send after transport endpoint shutdown
109: Too many references: cannot splice
110: Connection timed out
111: Connection refused
112: Host is down
113: No route to host
114: Operation already in progress
115: Operation now in progress
116: Stale NFS file handle
117: Structure needs cleaning
118: Not a XENIX named type file
119: No XENIX semaphores available
120: Is a named type file
121: Remote I/O error
122: Quota exceeded
123: No medium found
124: Wrong medium type
125: Unknown Error (125)
126: Unknown Error (126)


So I do not have to check for error range validity myself. Next step
would be produce a crash and check the runtime error validity, just in
case it matches. :-)


Pity the help pages I found (like the one for ioresult) do not mention
SysErrorMessage.

-- 
Cheers / Saludos,

		Carlos E. R.
		(from 42.3 x86_64 "Malachite" at Telcontar)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20180501/712a90c0/attachment.sig>


More information about the Lazarus mailing list