[fpc-pascal] exceptions

Jonas Maebe jonas.maebe at elis.ugent.be
Wed May 27 20:53:35 CEST 2009


On 27 May 2009, at 19:24, Rainer Stratmann wrote:

> Am Mittwoch, 27. Mai 2009 11:45 schrieb Vincent Snijders:
>> Rainer Stratmann schreef:
>>> Am Dienstag, 26. Mai 2009 22:27 schrieb Jonas Maebe:
>>>> Well, as I said: it does not raise any exceptions.
>>>
>>> Would it be possible to catch that exception?
>>> With the try except block?
>>> Are other functions existing to catch linux exceptions?
>>
>> No, you cannot catch exception that are not raised.
> What does 'raised' exactly mean?

http://www.freepascal.org/docs-html/ref/refse73.html

Please provide a compilable sample that demonstrates the problem you  
are having. I'm guessing you can "solve" it by adding the sysutils  
unit to your uses clause (because currently you're probably getting a  
plain run time error, and using the sysutils unit means that it will  
be converted into an exception that you can catch), but that would  
just be a hack. You probably also would have to put the try/catch  
around the next debugging writeln, and not around the send() call to  
catch the exception (because send() does not cause any inoutres  
checks, but writeln() does)

I really have no idea how the error result of send() could end up in  
inoutres though (which is, I think, the only way that could cause the  
RTL to produce a run time error in response to a failed send() call).  
There are variants of the socket routines that work on text files and  
that do set inoutres, but send() is not one of them.

So please, provide source code (even if some hack seems to solve the  
problem) so we don't have to send 10 more mails guessing about what  
you might be doing and what might be going wrong.


Jonas



More information about the fpc-pascal mailing list