capture ESocketError, host has failed to respond

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
BoOmSoLuTioN
Posts: 1
Joined: Mon 09 Jun 2008 13:13

capture ESocketError, host has failed to respond

Post by BoOmSoLuTioN » Mon 09 Jun 2008 13:21

hello,

please, how to capture Exception ESocketError (10060), host has failed to respond


i try this but is not work :

Code: Select all

  try
      cnx.ConnectString:='login/[email protected]:1521:BIZ';
      cnx.Connect;
  Except on E: ESocketError  do
        begin
             showmessage('Error; Enable to connect!');
        end;
  end;

cnx : is a TOraSession Compenent.

thanx.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 10 Jun 2008 07:04

Try to catch EOraError:

Code: Select all

try
...
except
  on E: EOraError do begin
    ShowMessage('Error; Enable to connect!'); 
  end; 
end;
You should add OraError unit to 'uses'.

If this does not work, you can get actual type of exception using the following code:

Code: Select all

try
...
except
  on E: Exception do begin
    ShowMessage(E.ClassName); 
  end; 
end;

Post Reply