Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jan : Re: Tidtcpserver onexecute exception
| Subject: | Re: Tidtcpserver onexecute exception |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Fri, 25 Jan 2008 10:31:24 |
"Emin turan" <none@none.com> wrote in message
news:4799d324$1@newsgroups.borland.com...
> does this code cause any problem for indy?
No, as long as you rethrow Indy's own exceptions. But there is a cleaer way
to code it without using Pos():
procedure TfrmTcpserver.ServerExecute(AThread: TIdPeerThread);
begin
try
.....
except
on E: Exception do
begin
if E is EIdException then Raise
else ExceptionToLog(e.Message);
end;
end;
end;
Or:
procedure TfrmTcpserver.ServerExecute(AThread: TIdPeerThread);
begin
try
.....
except
on E: EIdException do
begin
Raise;
end;
on E: Exception do
begin
ExceptionToLog(e.Message);
end;
end;
end;
Gambit
none