Skip to content

Commit 78a39bb

Browse files
author
fengyunhai
committed
新增:HttpManager.get对于WebException的处理
BucketManager.stat等操作调用到HttpManager.get方法,如果出现错误(如502错误)能够及时被处理。
1 parent dc9add3 commit 78a39bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Qiniu/Http/HttpManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ public void get(string pUrl, Dictionary<string, string> pHeaders,
5555
{
5656
vWebReq = (HttpWebRequest)WebRequest.Create(pUrl);
5757
}
58+
catch(WebException wexp)
59+
{
60+
// FIX-HTTP 4xx/5xx Error 2016-11-22, 17:00 @fengyh
61+
HttpWebResponse xWebResp = wexp.Response as HttpWebResponse;
62+
handleErrorWebResponse(xWebResp, pCompletionHandler, wexp);
63+
}
5864
catch (Exception ex)
5965
{
6066
if (pCompletionHandler != null)

0 commit comments

Comments
 (0)