On Wednesday, July 17, 2013 5:53 PM [GMT+1=CET],
zayin wrote:

> Hi,
> 
> I am trying to catch exceptions from a TWSocket.Connect call.
> 
> The issue is most of the time it is a dot number IP address used for
> the addr but sometimes it is a dot name address.
> 
> I call connect and if the DNS fails I want to catch the exception. The
> OnError does fire but the LastError is zero.

The OnError "feature" is buggy.
Simply do not assign the OnError property in order to enable 
true exception raising from methods that call method 
TCustomWSocket.RaiseException
and wrap such calls in Try-Except blocks instead.
This OnError stuff was added to please people not familiar with
exception handling.

> What am I missing?

I thing nothing.

-- 
Arno

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to