Skip to content

Commit 784db91

Browse files
authored
Merge pull request #331 from XiaopingSun/addProtocolErrorType
add protocol error type
2 parents 7d42627 + 80c1b4c commit 784db91

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

QiniuSDK/Http/QNHttpResponseInfo.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ - (instancetype)initWithResponseInfoHost:(NSString *)host
131131
_errorType = parse_error;
132132
} else if (error.code == -999) {
133133
_errorType = user_canceled;
134+
} else if (error.code == 100) {
135+
_errorType = protocol_error;
134136
} else {
135137
_errorType = unknown_error;
136138
}

QiniuSDK/Storage/QNUploadInfoCollector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ extern NSString *const parse_error; // 解析响应错误
6464
extern NSString *const malicious_response; // 用户劫持错误
6565
extern NSString *const user_canceled; // 用户主动取消
6666
extern NSString *const bad_request; // API 失败是由于客户端的参数错误导致,⽆法依靠重试来解决的(例如 4xx 错误, upload token 错误,⽬标 bucket 不存在,⽂件已经存在,区域不正确,额度不够 等)
67+
extern NSString *const protocol_error; // 协议错误
6768

6869
extern int64_t QN_IntNotSet;
6970

QiniuSDK/Storage/QNUploadInfoCollector.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
NSString *const malicious_response = @"malicious_response";
4646
NSString *const user_canceled = @"user_canceled";
4747
NSString *const bad_request = @"bad_request";
48+
NSString *const protocol_error = @"protocol_error";
4849

4950
static NSString *const requestTypes[] = {@"form", @"mkblk", @"bput", @"mkfile", @"put", @"init_parts", @"upload_part", @"complete_part", @"uc_query", @"httpdns_query"};
5051

QiniuSDKTests/QNTestConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
// Copyright (c) 2014年 Qiniu. All rights reserved.
77
//
88

9-
static NSString *const g_token = @"bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:D0XrIxOVDM8ARHvGcI9-fZqg4Pc=:eyJzY29wZSI6InNodWFuZ2h1bzEiLCJkZWFkbGluZSI6MTU5MDA1NzM3NH0K";
9+
static NSString *const g_token = @"bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:1EBiuzptfR1Akw5B4QwxJRYYelg=:eyJzY29wZSI6InNodWFuZ2h1bzEiLCJkZWFkbGluZSI6MTU5MDgwODA1MX0K";

0 commit comments

Comments
 (0)