title: exception handling with http client - c#
body: <p>I have the following code. This already exists. What exactly is each block of <code>catch</code> doing here. Is this the correct way of handling exceptions on ASP.NET Web API? If not, how can I handle exceptions the correct way.</p>
  <p>Note: The <code>CustomServiceException</code> in the second <code>catch</code> block simply extends the Exception class.</p>
  <pre><code>        try
          {
              ... I am calling my exteral API here using HttpClient class
          }
          catch(HttpRequestException ex)
          {
             Logger.Error(&quot;my error message&quot;, ex.Message);                
          }
          catch(CustomServiceException)
          {
              throw;  
          }                
          catch (Exception ex)
          {
              Logger.Error(&quot;my error message&quot;,ex);
          }
  </code></pre>