From 97e2dea10881286cb14c961816078d5099904310 Mon Sep 17 00:00:00 2001 From: Yuhan ZOU Date: Mon, 13 Jun 2016 12:08:33 +0800 Subject: [PATCH] Release 1.4.9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复 Debug 模式下的问题 --- .../SensorsAnalyticsSDK.podspec | 2 +- .../SensorsAnalyticsSDK/SensorsAnalyticsSDK.m | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/SensorsAnalyticsSDK/SensorsAnalyticsSDK.podspec b/SensorsAnalyticsSDK/SensorsAnalyticsSDK.podspec index 17365322..82692d65 100644 --- a/SensorsAnalyticsSDK/SensorsAnalyticsSDK.podspec +++ b/SensorsAnalyticsSDK/SensorsAnalyticsSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SensorsAnalyticsSDK" - s.version = "1.4.8" + s.version = "1.4.9" s.summary = "The offical iOS SDK of Sensors Analytics." s.homepage = "http://www.sensorsdata.cn" s.source = { :git => 'https://github.com/sensorsdata/sa-sdk-ios.git', :tag => "v#{s.version}" } diff --git a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/SensorsAnalyticsSDK.m b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/SensorsAnalyticsSDK.m index 8d6c1d2d..b0de3d20 100755 --- a/SensorsAnalyticsSDK/SensorsAnalyticsSDK/SensorsAnalyticsSDK.m +++ b/SensorsAnalyticsSDK/SensorsAnalyticsSDK/SensorsAnalyticsSDK.m @@ -26,7 +26,7 @@ #import "SASwizzler.h" #import "SensorsAnalyticsSDK.h" -#define VERSION @"1.4.8" +#define VERSION @"1.4.9" #define PROPERTY_LENGTH_LIMITATION 255 @@ -321,14 +321,16 @@ - (void)flush { NSString *urlResponseContent = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSString *errMsg = [NSString stringWithFormat:@"%@ flush failure with response '%@'.", self, urlResponseContent]; if (_debugMode != SensorsAnalyticsDebugOff) { - SALog(@"=========================================================================="); - SALog(@"%@ invalid message: %@", self, jsonString); - SALog(@"%@ ret_code: %ld", self, [urlResponse statusCode]); - SALog(@"%@ ret_content: %@", self, urlResponseContent); + SAError(@"=========================================================================="); + SAError(@"%@ invalid message: %@", self, jsonString); + SAError(@"%@ ret_code: %ld", self, [urlResponse statusCode]); + SAError(@"%@ ret_content: %@", self, urlResponseContent); - @throw [SensorsAnalyticsDebugException exceptionWithName:@"IllegalDataException" - reason:errMsg - userInfo:nil]; + if ([urlResponse statusCode] >= 300) { + @throw [SensorsAnalyticsDebugException exceptionWithName:@"IllegalDataException" + reason:errMsg + userInfo:nil]; + } } else { SAError(@"%@", errMsg); flushSucc = NO;