Improve error handling during backup persistence (#4320)
<!-- PR description--> We were not catching missing snapshot ID sooner. Fixed it. --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [x] 🧹 Tech Debt/Cleanup #### Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * https://github.com/alcionai/corso/issues/4305 #### Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
a28f57a6de
commit
7050b0c9d2
@ -856,12 +856,23 @@ func (op *BackupOperation) createBackupModels(
|
|||||||
// are generated during the serialization process.
|
// are generated during the serialization process.
|
||||||
errs := fault.New(true)
|
errs := fault.New(true)
|
||||||
|
|
||||||
|
// We don't persist a backup if there were non-recoverable errors seen
|
||||||
|
// during the operation, regardless of the failure policy. Unlikely we'd
|
||||||
|
// hit this here as the preceding code should already take care of it.
|
||||||
|
if op.Errors.Failure() != nil {
|
||||||
|
return clues.Wrap(op.Errors.Failure(), "non-recoverable failure").WithClues(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
if deets == nil {
|
if deets == nil {
|
||||||
return clues.New("no backup details to record").WithClues(ctx)
|
return clues.New("no backup details to record").WithClues(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = clues.Add(ctx, "details_entry_count", len(deets.Entries))
|
ctx = clues.Add(ctx, "details_entry_count", len(deets.Entries))
|
||||||
|
|
||||||
|
if len(snapID) == 0 {
|
||||||
|
return clues.New("no snapshot ID to record").WithClues(ctx)
|
||||||
|
}
|
||||||
|
|
||||||
err := sscw.Collect(ctx, streamstore.DetailsCollector(deets))
|
err := sscw.Collect(ctx, streamstore.DetailsCollector(deets))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return clues.Wrap(err, "collecting details for persistence").WithClues(ctx)
|
return clues.Wrap(err, "collecting details for persistence").WithClues(ctx)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user