Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed Sharpen.HttpURLConnection.Response to handle a thrown WebExcept…

…ion when calling HttpWebRequest.GetResponse().
  • Loading branch information...
commit a4524a76d523ec0e15ed0a1cf22ace4986d37f1e 1 parent 263a79f
@fealebenpae fealebenpae authored slluis committed
Showing with 10 additions and 1 deletion.
  1. +10 −1 Sharpen/Sharpen/HttpURLConnection.cs
View
11 Sharpen/Sharpen/HttpURLConnection.cs
@@ -64,7 +64,16 @@ internal HttpURLConnection (Uri uri, Proxy p)
HttpWebResponse Response {
get {
if (reqResponse == null)
- reqResponse = (HttpWebResponse) request.GetResponse ();
+ {
+ try
+ {
+ reqResponse = (HttpWebResponse) request.GetResponse ();
+ }
+ catch (WebException ex)
+ {
+ reqResponse = (HttpWebResponse) ex.Response;
+ }
+ }
return reqResponse;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.