diff --git a/QiniuSDK/Http/QNHttpResponseInfo.m b/QiniuSDK/Http/QNHttpResponseInfo.m index a5cfc4cd..535926a6 100644 --- a/QiniuSDK/Http/QNHttpResponseInfo.m +++ b/QiniuSDK/Http/QNHttpResponseInfo.m @@ -131,6 +131,8 @@ - (instancetype)initWithResponseInfoHost:(NSString *)host _errorType = parse_error; } else if (error.code == -999) { _errorType = user_canceled; + } else if (error.code == 100) { + _errorType = protocol_error; } else { _errorType = unknown_error; } diff --git a/QiniuSDK/Storage/QNUploadInfoCollector.h b/QiniuSDK/Storage/QNUploadInfoCollector.h index ca286b84..d93d1624 100644 --- a/QiniuSDK/Storage/QNUploadInfoCollector.h +++ b/QiniuSDK/Storage/QNUploadInfoCollector.h @@ -64,6 +64,7 @@ extern NSString *const parse_error; // 解析响应错误 extern NSString *const malicious_response; // 用户劫持错误 extern NSString *const user_canceled; // 用户主动取消 extern NSString *const bad_request; // API 失败是由于客户端的参数错误导致,⽆法依靠重试来解决的(例如 4xx 错误, upload token 错误,⽬标 bucket 不存在,⽂件已经存在,区域不正确,额度不够 等) +extern NSString *const protocol_error; // 协议错误 extern int64_t QN_IntNotSet; diff --git a/QiniuSDK/Storage/QNUploadInfoCollector.m b/QiniuSDK/Storage/QNUploadInfoCollector.m index 5ef880af..9c1a16f1 100644 --- a/QiniuSDK/Storage/QNUploadInfoCollector.m +++ b/QiniuSDK/Storage/QNUploadInfoCollector.m @@ -45,6 +45,7 @@ NSString *const malicious_response = @"malicious_response"; NSString *const user_canceled = @"user_canceled"; NSString *const bad_request = @"bad_request"; +NSString *const protocol_error = @"protocol_error"; static NSString *const requestTypes[] = {@"form", @"mkblk", @"bput", @"mkfile", @"put", @"init_parts", @"upload_part", @"complete_part", @"uc_query", @"httpdns_query"}; diff --git a/QiniuSDKTests/QNTestConfig.h b/QiniuSDKTests/QNTestConfig.h index 30dbc9db..60b0daaf 100755 --- a/QiniuSDKTests/QNTestConfig.h +++ b/QiniuSDKTests/QNTestConfig.h @@ -6,4 +6,4 @@ // Copyright (c) 2014年 Qiniu. All rights reserved. // -static NSString *const g_token = @"bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:D0XrIxOVDM8ARHvGcI9-fZqg4Pc=:eyJzY29wZSI6InNodWFuZ2h1bzEiLCJkZWFkbGluZSI6MTU5MDA1NzM3NH0K"; +static NSString *const g_token = @"bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:1EBiuzptfR1Akw5B4QwxJRYYelg=:eyJzY29wZSI6InNodWFuZ2h1bzEiLCJkZWFkbGluZSI6MTU5MDgwODA1MX0K";