Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use TIdHttp inside TThread anonymous function doesn't raise exceptions
#5
Sorry, maybe I explained it wrong.

I do catch server internal errors inside the TMemo fine, but for example when I send a request to a server that is not running, supposedly I should get an error "connection refused" because the client can't connect to the server in the first place. Now I if understand this correctly that type of errors are not internal server error and should be caught outside the thread executing the request. Now what I was trying to achieve is to make sure that all returned content from the server whether it is an error or not must be displayed in Memo, all other exception must be caught in a normal Message box.

Now just to understand this correctly If I want to make TIdHTTP behave the same way as TRestRequest I must enable both hoWantProtocolErrorContent ,hoNoProtocolErrorException So that content is passed to Response ContentStream. Right? Then any other error will be caught outside the thread in the CriticalErrorEvent.

Am I right or not?
Reply


Messages In This Thread
RE: Use TIdHttp inside TThread anonymous function doesn't raise exceptions - by Ahmed Sayed - 09-03-2020, 04:00 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)