Log if file tagged as malware by graph (#2700)
Graph exposes a "malware" filed in the delta response. This just logs that if we fail to download an item. --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [ ] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> #### Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
214db6fe97
commit
5255517067
@ -410,7 +410,12 @@ func (oc *Collection) populateItems(ctx context.Context, errs *fault.Bus) {
|
||||
|
||||
// check for errors following retries
|
||||
if err != nil {
|
||||
logger.Ctx(ctx).With("error", err.Error()).Error("downloading item")
|
||||
if item.GetMalware() != nil {
|
||||
logger.Ctx(ctx).With("error", err.Error(), "malware", true).Error("downloading item")
|
||||
} else {
|
||||
logger.Ctx(ctx).With("error", err.Error()).Error("downloading item")
|
||||
}
|
||||
|
||||
el.AddRecoverable(clues.Stack(err).WithClues(ctx).Label(fault.LabelForceNoBackupCreation))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -183,6 +183,7 @@ func defaultItemPager(
|
||||
"sharepointIds",
|
||||
"size",
|
||||
"deleted",
|
||||
"malware",
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user