mono / ngit

Automated jgit port to c#
261 stars 152 forks source link

[Sharpen] HttpURLConnection.Response results in WebException when StatusCode=401 #11

Closed fealebenpae closed 13 years ago

fealebenpae commented 13 years ago

The .NET Framework HttpWebRequest.GetResponse() throws a WebException when the response's status code is HTTP 401. The actual response is contained in the Exception.

However, the getter of the Response property of HttpURLConnection does not try to catch this type of exception, which results in an unhandled WebException when HTTP authorization fails, instead of the expected JGitInternalException.

slluis commented 13 years ago

Fix committed. Thanks!