Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Re: How to prevent exception messages being shown in FTP client application & FT
| Subject: | Re: How to prevent exception messages being shown in FTP client application & FT |
| Posted by: | "Bryan Valencia" (borng.some_yahoo@spamgourmet.com) |
| Date: | Wed, 27 Dec 2006 11:35:33 |
You should do what was mentioned before, but I would add that there are 2
approaches to what you originally asked.
1. the ERRORPROC - this is a way of trapping exceptions application wide.
For unattended apps, you may want to log them to a text file or send them in
an email or reboot the server or something.
2. use try...except along with try...finally
try...finally is good for resource protection, but try except lets you code
responses to potential errors.
like this:
something:=tstringlist.create; // a resource to protect
try
try
myftp.connect;
DoOtherStuff;
except
handle problems here
end;
finally
something.free;
end;
none