 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jordan Guest
|
Posted: Sat Jan 22, 2005 2:48 pm Post subject: Indy refuses to accept try except ? |
|
|
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
|
Posted: Sat Jan 22, 2005 7:12 pm Post subject: Re: Indy refuses to accept try except ? |
|
|
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
|
Posted: Sun Jan 23, 2005 11:59 pm Post subject: Re: Indy refuses to accept try except ? |
|
|
"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 |
|
 |
|
|
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
|
|