临时fix一处debug宏开启,上报功能未启动导致的debug crash review by mengshun
Showing
2 changed files
with
10 additions
and
26 deletions
@@ -236,10 +236,9 @@ static dispatch_queue_t persisting_queue() { | @@ -236,10 +236,9 @@ static dispatch_queue_t persisting_queue() { | ||
236 | { | 236 | { |
237 | if (perf == nil || ![perf isKindOfClass:[YHPerformance class]]) { | 237 | if (perf == nil || ![perf isKindOfClass:[YHPerformance class]]) { |
238 | #ifdef DEBUG | 238 | #ifdef DEBUG |
239 | - NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException | 239 | + @throw [NSException exceptionWithName:NSInvalidArgumentException |
240 | reason:@"The input parameter is nil or an unexpected value." | 240 | reason:@"The input parameter is nil or an unexpected value." |
241 | userInfo:nil]; | 241 | userInfo:nil]; |
242 | - [exception raise]; | ||
243 | #endif | 242 | #endif |
244 | return; | 243 | return; |
245 | } | 244 | } |
@@ -261,10 +260,9 @@ static dispatch_queue_t persisting_queue() { | @@ -261,10 +260,9 @@ static dispatch_queue_t persisting_queue() { | ||
261 | { | 260 | { |
262 | if (itemData == nil || ![itemData isKindOfClass:[YHAnalyItemData class]]) { | 261 | if (itemData == nil || ![itemData isKindOfClass:[YHAnalyItemData class]]) { |
263 | #ifdef DEBUG | 262 | #ifdef DEBUG |
264 | - NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException | 263 | + @throw [NSException exceptionWithName:NSInvalidArgumentException |
265 | reason:@"The input parameter is nil or an unexpected value." | 264 | reason:@"The input parameter is nil or an unexpected value." |
266 | userInfo:nil]; | 265 | userInfo:nil]; |
267 | - [exception raise]; | ||
268 | #endif | 266 | #endif |
269 | return; | 267 | return; |
270 | } | 268 | } |
@@ -322,20 +320,18 @@ static dispatch_queue_t persisting_queue() { | @@ -322,20 +320,18 @@ static dispatch_queue_t persisting_queue() { | ||
322 | } else { | 320 | } else { |
323 | #ifdef DEBUG | 321 | #ifdef DEBUG |
324 | // 不处理非 Event 和 Error 类型的数据 | 322 | // 不处理非 Event 和 Error 类型的数据 |
325 | - NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException | 323 | + @throw [NSException exceptionWithName:NSInvalidArgumentException |
326 | reason:@"The input parameter is an unexpected value." | 324 | reason:@"The input parameter is an unexpected value." |
327 | userInfo:nil]; | 325 | userInfo:nil]; |
328 | - [exception raise]; | ||
329 | #endif | 326 | #endif |
330 | } | 327 | } |
331 | 328 | ||
332 | } else { | 329 | } else { |
333 | #ifdef DEBUG | 330 | #ifdef DEBUG |
334 | // 不能存储 | 331 | // 不能存储 |
335 | - NSException *exception = [NSException exceptionWithName:NSMallocException | 332 | + @throw [NSException exceptionWithName:NSMallocException |
336 | reason:@"Can't create folder for persisting." | 333 | reason:@"Can't create folder for persisting." |
337 | userInfo:nil]; | 334 | userInfo:nil]; |
338 | - [exception raise]; | ||
339 | #endif | 335 | #endif |
340 | } | 336 | } |
341 | } | 337 | } |
@@ -344,10 +340,9 @@ static dispatch_queue_t persisting_queue() { | @@ -344,10 +340,9 @@ static dispatch_queue_t persisting_queue() { | ||
344 | { | 340 | { |
345 | if (itemData == nil || ![itemData isKindOfClass:[YHAnalyItemData class]]) { | 341 | if (itemData == nil || ![itemData isKindOfClass:[YHAnalyItemData class]]) { |
346 | #ifdef DEBUG | 342 | #ifdef DEBUG |
347 | - NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException | 343 | + @throw [NSException exceptionWithName:NSInvalidArgumentException |
348 | reason:@"The input parameter is nil or an unexpected value." | 344 | reason:@"The input parameter is nil or an unexpected value." |
349 | userInfo:nil]; | 345 | userInfo:nil]; |
350 | - [exception raise]; | ||
351 | #endif | 346 | #endif |
352 | return; | 347 | return; |
353 | } | 348 | } |
@@ -435,10 +430,9 @@ static dispatch_queue_t persisting_queue() { | @@ -435,10 +430,9 @@ static dispatch_queue_t persisting_queue() { | ||
435 | } else { | 430 | } else { |
436 | #ifdef DEBUG | 431 | #ifdef DEBUG |
437 | // 不处理非 Event 和 Error 类型的数据 | 432 | // 不处理非 Event 和 Error 类型的数据 |
438 | - NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException | 433 | + @throw [NSException exceptionWithName:NSInvalidArgumentException |
439 | reason:@"The input parameter is an unexpected value." | 434 | reason:@"The input parameter is an unexpected value." |
440 | userInfo:nil]; | 435 | userInfo:nil]; |
441 | - [exception raise]; | ||
442 | #endif | 436 | #endif |
443 | } | 437 | } |
444 | } | 438 | } |
@@ -557,13 +551,6 @@ static dispatch_queue_t persisting_queue() { | @@ -557,13 +551,6 @@ static dispatch_queue_t persisting_queue() { | ||
557 | if ([allStatus count]) { | 551 | if ([allStatus count]) { |
558 | [allStatus replaceObjectAtIndex:0 withObject:self.currentStatus.jsonDictionary]; | 552 | [allStatus replaceObjectAtIndex:0 withObject:self.currentStatus.jsonDictionary]; |
559 | [self.immediUploadItemDic setObject:allStatus forKey:JsonKeyDataTypeStatus]; | 553 | [self.immediUploadItemDic setObject:allStatus forKey:JsonKeyDataTypeStatus]; |
560 | - } else { | ||
561 | -#ifdef DEBUG | ||
562 | - NSException *exception = [NSException exceptionWithName:NSGenericException | ||
563 | - reason:@"appId and sessionId do not be initialized. Please use prepareImmediUploadDic:sessionId:channelId: first." | ||
564 | - userInfo:nil]; | ||
565 | - [exception raise]; | ||
566 | -#endif | ||
567 | } | 554 | } |
568 | } | 555 | } |
569 | } | 556 | } |
@@ -581,10 +568,9 @@ static dispatch_queue_t persisting_queue() { | @@ -581,10 +568,9 @@ static dispatch_queue_t persisting_queue() { | ||
581 | { | 568 | { |
582 | if (event == nil || ![event isKindOfClass:[YHEvent class]]) { | 569 | if (event == nil || ![event isKindOfClass:[YHEvent class]]) { |
583 | #ifdef DEBUG | 570 | #ifdef DEBUG |
584 | - NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException | 571 | + @throw [NSException exceptionWithName:NSInvalidArgumentException |
585 | reason:@"The input parameter is nil or an unexpected value." | 572 | reason:@"The input parameter is nil or an unexpected value." |
586 | userInfo:nil]; | 573 | userInfo:nil]; |
587 | - [exception raise]; | ||
588 | #endif | 574 | #endif |
589 | return NO; | 575 | return NO; |
590 | } | 576 | } |
@@ -655,10 +641,9 @@ static dispatch_queue_t persisting_queue() { | @@ -655,10 +641,9 @@ static dispatch_queue_t persisting_queue() { | ||
655 | performanceData.net = self.currentStatus.net; | 641 | performanceData.net = self.currentStatus.net; |
656 | if (performanceData == nil || ![performanceData isKindOfClass:[YHPerformance class]]) { | 642 | if (performanceData == nil || ![performanceData isKindOfClass:[YHPerformance class]]) { |
657 | #ifdef DEBUG | 643 | #ifdef DEBUG |
658 | - NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException | 644 | + @throw [NSException exceptionWithName:NSInvalidArgumentException |
659 | reason:@"The input parameter is nil or an unexpected value." | 645 | reason:@"The input parameter is nil or an unexpected value." |
660 | userInfo:nil]; | 646 | userInfo:nil]; |
661 | - [exception raise]; | ||
662 | #endif | 647 | #endif |
663 | return NO; | 648 | return NO; |
664 | } | 649 | } |
@@ -730,10 +715,9 @@ static dispatch_queue_t persisting_queue() { | @@ -730,10 +715,9 @@ static dispatch_queue_t persisting_queue() { | ||
730 | { | 715 | { |
731 | if (errorData == nil || ![errorData isKindOfClass:[YHError class]]) { | 716 | if (errorData == nil || ![errorData isKindOfClass:[YHError class]]) { |
732 | #ifdef DEBUG | 717 | #ifdef DEBUG |
733 | - NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException | 718 | + @throw [NSException exceptionWithName:NSInvalidArgumentException |
734 | reason:@"The input parameter is nil or an unexpected value." | 719 | reason:@"The input parameter is nil or an unexpected value." |
735 | userInfo:nil]; | 720 | userInfo:nil]; |
736 | - [exception raise]; | ||
737 | #endif | 721 | #endif |
738 | return NO; | 722 | return NO; |
739 | } | 723 | } |
-
Please register or login to post a comment