title: How To Properly Handle A 404 IDHTTP Error
body: <p>I am having trouble understanding how to trap a http exception with idHTTP.  Should idHTTP errors be handled in a IDHTTP event or like the code shown below?</p>
  
  <pre><code>try
    iIdHTTP.Get(iURL,iComponentStream[0]);
  except
    on E: EIdHTTPProtocolException do
    begin
      MessageBox(0, PChar(ActiveImage_IdHTTP[0].ResponseText), 'HTTP Error', MB_ICONWARNING or MB_OK);
      exit;
    end;
  end;
  </code></pre>
  
  <p>Either I must be doing something totally incorrect or something is strange is occurring.  When I call this, and a 404 exception occurs and the exception dialog ok button is selected and the dialog closes, but the code in the exception block is not called and the messagebox never appears.  What am I doing incorrectly?</p>
  
  <p>When an exception occurs are there error codes that can be used to this a little better like show a 404 error in a messagebox?  Where can I find a list of TIDHTTP error codes?</p>