Re: Message "No files found"

Giganews Newsgroups
Subject: Re: Message "No files found"
Posted by:  Remy Lebeau (TeamB) (gambit…@yahoo.com)
Date: Sat, 28 Jun 2003

"Christoph Boenig" <christoph.boen…@onlinehome.de> wrote in message
news:0ADF0F0F1C75E240christoph.boen…@onlinehome.de...

> I've a question to the IdFTP component. I scan a directory
> for new files with the List command. If there are no files the
> component shows a Message "No files found".

Indy is designed to throw exceptions when errors occur.  The message you are
seeing is a result of your own code's lack of exception handling when
calling List(), thus if List() errors it will throw an exception and your
code is allowing the exception to work its way up to the default handler
which then displays the message in a popup window.

> How can I hook into that no message appear and I can resolve
> the problem programaticly

Simply wrap the call to List() in a try...catch block.

Gambit

Replies

In response to

Message "No files found" posted by Christoph Boenig on Sat, 28 Jun 2003