Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't catch ESocketError

Status
Not open for further replies.

lobOnline

Programmer
Apr 5, 2001
12
NL
I'm using a TClientSocket component. When I do a connect to an internet address (not ip), but I'm not connected to the internet I get an ESocketEror resulting in the following message: "Windows socket error: (11001), on API 'Async Lookup'.I'm trying to catch this ESocketError. But I can't!

I know there is an OnError event and I have a handler for it. I know this Error handler is working because occassionaly it's called.

I've tried many things like

try
{
Socket->Open();
}
catch(ESocketError &e)
{
Error("Could not open socket!");
}

but they did not work :(

Can anybody help me resolve this problem?
 
You are aware that Borland itself ignores the catch and still displays the error right? If you hit F9 again, it will continue to run normally... The catch only stops runtime errors.. not compiler erors.. Eg, running the exe by double clicking on it, the exception will be cought and the prog will continue to run
 
I am aware of this. I also know that if you look at the debugger options you can disable this option. I just want to catch the exception so I can output my own error message instead of this one:

Windows socket error: (11001), on API 'Async Lookup'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top