BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Indy refuses to accept try except ?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Jordan
Guest





PostPosted: Sat Jan 22, 2005 2:48 pm    Post subject: Indy refuses to accept try except ? Reply with quote



Hello,

i have this code

try
IdTimeClient.Host := 'host';
except
end;


in an TIdTime component (Indy). The problem is when the server is down. It
displays a error message. In C++ you can say

try {
}
catch(...) {}

and avoid messages. In Delphi it doesnt seem to work. Why?

Thanks


Back to top
Andy Neillans
Guest





PostPosted: Sat Jan 22, 2005 7:12 pm    Post subject: Re: Indy refuses to accept try except ? Reply with quote



Jordan wrote:

Quote:
Hello,

i have this code

try
IdTimeClient.Host := 'host';
except
end;


in an TIdTime component (Indy). The problem is when the server is
down. It displays a error message. In C++ you can say

try {
}
catch(...) {}

and avoid messages. In Delphi it doesnt seem to work. Why?

Thanks

Should do; are you running the application in the Delphi IDE? If that
is the case, you will see every exception, even if you have it trapped
with try .. except.

Also, where does the error occur? Is it triggered after you set the
host? If so, are you sure the component is created?

--
Regards,
Andy Neillans
--
Posted using XanaNews version 1.17.1.2

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sun Jan 23, 2005 11:59 pm    Post subject: Re: Indy refuses to accept try except ? Reply with quote




"Jordan" <jordan (AT) email (DOT) nl> wrote


Quote:
try
IdTimeClient.Host := 'host';
except
end;

That exception handling code is meaningless. Setting the Host property does
not throw any exceptions.

Quote:
in an TIdTime component (Indy). The problem is when
the server is down. It displays a error message.

You probably did not use exception handling when calling the SyncTime()
method or querying the DateTime/DateTimeCard property (you did not show
which one you are actually using).

Quote:
it doesnt seem to work. Why?

You are trying to catch the exception in the wrong place to begin with.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.