Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Apr : IdHTTP not showing exception in TThread

www.cryer.info
Managed Newsgroup Archive

IdHTTP not showing exception in TThread

Subject:IdHTTP not showing exception in TThread
Posted by:"Jack MacRank" (ja..@macrank.com)
Date:Mon, 28 Apr 2008 02:04:11

Hello,

Everything is working great with the IdHTTP 10.2.3 component but I have
a question.  When I create a TIdHTTP in the main application thread and
call Get to a known bad URL, a message box shows stating the 404 error.
  However, when I use the same code in a TThread class, no message box
shows but I can still catch the exception.  Is there a reason for the
message box not showing the error in a TThread class?

My code:

THTTPWorker = class(TThread)
protected
   procedure Execute; override;
end;

procedure THTTPWorker.Execute;
var
   http: TIdHTTP;
begin

   FreeOnTerminate := True;

   http := TIdHTTP.Create;

   try

     http.Get(a-known-bad-url);

   finally

     FreeAndNil(http);

   end;

end;

***Thank you in advance for your time and help!

Replies:

www.cryer.info
Managed Newsgroup Archive