Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR on E: EIdSocketError do begin - Delphi

Tags:

delphi

enter image description here

I'm starting in Delphi , and creating a program to download ... In which I realize that when I try to download and type a wrong URL and it can not download ... Generates the error Error # 10060 Socket connection Time out ... I know that this error is generated when it gets too long trying to make a connection to a URL that does not exist ....

E: EIdHTTPProtocolException

he Raises the number 0 (zero ) Error ... it does not exist in HTTP ...

I'm trying to prevent this error appears , it stops trying to access the page ... but I want the response to this error ... and cause it not to appear ....

I believe it is using: on E: EIdSocketError the begin ...

But the program generates error when I try to use : undeclared undefined EIdSocketError

How am by starting in delphi ... I do not know where I'm going wrong ... how to correct this error :

 undeclared undefined EIdSocketError

[ dcc32 Error] Unit1.pas ( 162 ) : E2003 Undeclared identifier: ' EIdSocketError '

 

except
         on E: EIdSocketError do begin

         end ;
         on E: EIdHTTPProtocolException the
             Begin
             / / Handle the error generated
               code_erro : = IdHTTP.ResponseCode ;
             / / code_erro : = E.ErrorCode ;
             end
        end ;
like image 474
user3185448 Avatar asked Dec 16 '22 02:12

user3185448


1 Answers

EIdSocketError is defined in the IdStack unit. You need to add that unit to your uses clause.

like image 59
Remy Lebeau Avatar answered Dec 27 '22 19:12

Remy Lebeau