Re: Indy9: connect or passwort error

Giganews Newsgroups
Subject: Re: Indy9: connect or passwort error
Posted by:  David Goadby (dav…
Date: Fri, 13 Aug 2004

Hi Heiko,

I am not sure what you mean so I assume you want to detect an ftp connect
exception. If I am wrong then please add some more detail about your

Wrap a Try/Except around your code something like the example below. You
will see that I filter the socket errors to get a finer level of detail. Not
all of the errors are easy to test so I have covered most of the likely
errors. I am
building a complete unit that will catch most of the socket errors for
easier re-use. In the meantime the code below should do the trick for you.

    On EIdConnectTimeout do
          Memo1.Lines.Add('Connection timeout - no activity.');

    On EIdTFTPNoSuchUser do
          Memo1.Lines.Add('FTP User validation error - check Username &

    On EIdSocksAuthError do
          Memo1.Lines.Add('FTP Socket Authorisation error - check Username &

    On EIdSocksServerConnectionRefusedError do
          Memo1.Lines.Add('FTP Refused error - check Username & Password.');

    On EIdTFTPAccessViolation do
          Memo1.Lines.Add('FTP Access violation error - check Username &

    On E: EIdSocketError do
      // check messge code
          if Pos('11001', E.Message) > 0 then
                Memo1.Lines.Add('FTP Site not found error - check site
                Memo1.Lines.Add('Unexpected Socket error - ' + E.Message +

    On E: EIdProtocolReplyError do
          Memo1.Lines.Add('Login Error - check Username and Password.');

"Heiko Rompel" <norep…> wrote in message
> hello,
> it is possible to select what kind of connection error
> a ftp-connection break?
> I will select "passwort-error" and "server not found",
> is this possible?
> greetings from
> heiko


In response to

Indy9: connect or passwort error posted by Heiko Rompel on Fri, 13 Aug 2004