File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 2525
2626const UInt32 kQNRetryMax = 3 ;
2727
28- const float kQNTimeoutInterval = 30 .0 ;
28+ const float kQNTimeoutInterval = 60 .0 ;
Original file line number Diff line number Diff line change @@ -93,7 +93,12 @@ - (instancetype)init:(int)status
9393 NSError *tmp;
9494 NSDictionary *uInfo = [NSJSONSerialization JSONObjectWithData: body options: NSJSONReadingMutableLeaves error: &tmp];
9595 if (tmp != nil ) {
96- uInfo = @{ @" error" :[[NSString alloc ] initWithData: body encoding: NSUTF8StringEncoding] };
96+ // 出现错误时,如果信息是非UTF8编码会失败,返回nil
97+ NSString *str = [[NSString alloc ] initWithData: body encoding: NSUTF8StringEncoding];
98+ if (str == nil ) {
99+ str = @" " ;
100+ }
101+ uInfo = @{ @" error" : str };
97102 }
98103 _error = [[NSError alloc ] initWithDomain: domain code: _statusCode userInfo: uInfo];
99104 }
You can’t perform that action at this time.
0 commit comments