[fpc-pascal] exceptions

Jonas Maebe jonas.maebe at elis.ugent.be
Tue May 26 22:27:02 CEST 2009


On 26 May 2009, at 22:18, Rainer Stratmann wrote:

> Yes, the send function from the socket unit.

Well, as I said: it does not raise any exceptions.

> Situation:
>
> Connection is established.
> Client closes connection
> Server wants to sent data with send.
> Program stops with errorcode 13 (I found out that this is the linux  
> errorcode
> for permission denied).
>
> The error is reproduceable.

That's all quite possible, but it's not due to the send function  
raising an exception (as you also noticed, since adding try/except  
around the send function did not catch anything.

The socket unit calls through to unix routines (either via libc or via  
syscalls), and these set errno based on the result. However, that  
result should not propagate into inoutres/ioresult (which is what  
could make the program exit with that error at some point if you later  
on call e.g. writeln).


Jonas



More information about the fpc-pascal mailing list