File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -494,11 +494,19 @@ - (void)innerReport:(NSString *)jsonString token:(NSString *)token {
494494
495495 // 判断recorder文件大小是否超过maxRecordFileSize
496496 if (file.size < _config.maxRecordFileSize ) {
497- // 上传信息写入recorder文件
498- NSFileHandle *fileHandler = [NSFileHandle fileHandleForUpdatingAtPath: _recorderFilePath];
499- [fileHandler seekToEndOfFile ];
500- [fileHandler writeData: [finalRecordInfo dataUsingEncoding: NSUTF8StringEncoding]];
501- [fileHandler closeFile ];
497+ @try {
498+ // 上传信息写入recorder文件
499+ NSFileHandle *fileHandler = [NSFileHandle fileHandleForUpdatingAtPath: _recorderFilePath];
500+ [fileHandler seekToEndOfFile ];
501+ [fileHandler writeData: [finalRecordInfo dataUsingEncoding: NSUTF8StringEncoding]];
502+ [fileHandler closeFile ];
503+ } @catch (NSException *exception) {
504+ QNAsyncRunInMain (^{
505+ NSLog (@" NSFileHandle cannot write data: %@ " , exception.description );
506+ });
507+ } @finally {
508+ return ;
509+ }
502510 }
503511
504512 // 判断是否满足上传条件:文件大于上报临界值 && (首次上传 || 距上次上传时间大于_config.interval)
You can’t perform that action at this time.
0 commit comments