Skip to content

Commit ae33aff

Browse files
committed
🎨 Add logging
1 parent ee9e9ad commit ae33aff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sync.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,13 +1247,15 @@ func (repo *Repo) updateCloudIndexesV2(latest *entity.Index, context map[string]
12471247

12481248
data, err = repo.store.compressDecoder.DecodeAll(data, nil)
12491249
if nil != err {
1250+
logging.LogErrorf("decompress cloud indexes-v2.json failed: %s", err)
12501251
return
12511252
}
12521253

12531254
indexes := &cloud.Indexes{}
12541255
if 0 < len(data) {
12551256
if err = gulu.JSON.UnmarshalJSON(data, &indexes); nil != err {
12561257
logging.LogWarnf("unmarshal cloud indexes-v2.json failed: %s", err)
1258+
return
12571259
}
12581260

12591261
// Deduplication when uploading cloud snapshot indexes https://github.com/siyuan-note/siyuan/issues/8424
@@ -1285,12 +1287,14 @@ func (repo *Repo) updateCloudIndexesV2(latest *entity.Index, context map[string]
12851287
},
12861288
}, indexes.Indexes...)
12871289
if data, err = gulu.JSON.MarshalIndentJSON(indexes, "", "\t"); nil != err {
1290+
logging.LogErrorf("marshal cloud indexes-v2.json failed: %s", err)
12881291
return
12891292
}
12901293

12911294
data = repo.store.compressEncoder.EncodeAll(data, nil)
12921295

12931296
if err = gulu.File.WriteFileSafer(filepath.Join(repo.Path, "indexes-v2.json"), data, 0644); nil != err {
1297+
logging.LogErrorf("write indexes-v2.json failed: %s", err)
12941298
return
12951299
}
12961300

0 commit comments

Comments
 (0)