title: WebException thrown but never gets caught
body: <p>I have the following code:</p>
  
  <pre><code>try
  {
      using (var myHttpWebResponse = (HttpWebResponse) httPrequestCreated.GetResponse())
      {
          var streamResponse = myHttpWebResponse.GetResponseStream();
  
          if (streamResponse != null)
          {
              var streamRead = new StreamReader(streamResponse);
              var readBuff = new Char[256];
              var count = streamRead.Read(readBuff, 0, 256);         
  
              while (count &gt; 0)
              {
                  var outputData = new String(readBuff, 0, count);
                  finalResopnse += outputData;
                  count = streamRead.Read(readBuff, 0, 256);
              }
              streamRead.Close();
              streamResponse.Close();
              myHttpWebResponse.Close();
  
          }
      }
  }
  catch (WebException ex)
  {
      MessageBox.Show("something went wrong");
  }
  </code></pre>
  
  <p>The error code is <code>404 Not Found</code>, but instead of a MessageBox I get the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/IWXAl.png" alt="enter image description here"></p>
  
  <p>Why is the exception never caught?</p>