From 8860503bb8a0ddf57dbd9a21e3b4d0c6a2a8cd07 Mon Sep 17 00:00:00 2001 From: Keepers Date: Mon, 27 Feb 2023 15:13:21 -0700 Subject: [PATCH] amend kopia error clues (#2588) ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :broom: Tech Debt/Cleanup ## Issue(s) * #1970 ## Test Plan - [x] :zap: Unit test - [x] :green_heart: E2E --- src/internal/connector/exchange/api/contacts.go | 3 +-- src/internal/connector/exchange/api/events.go | 3 +-- src/internal/connector/exchange/api/mail.go | 3 +-- src/internal/operations/backup.go | 13 ++++++------- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/internal/connector/exchange/api/contacts.go b/src/internal/connector/exchange/api/contacts.go index 9658db809..35e5b5a35 100644 --- a/src/internal/connector/exchange/api/contacts.go +++ b/src/internal/connector/exchange/api/contacts.go @@ -101,8 +101,7 @@ func (c Contacts) GetContainerByID( // EnumerateContainers iterates through all of the users current // contacts folders, converting each to a graph.CacheFolder, and calling -// fn(cf) on each one. If fn(cf) errors, the error is aggregated -// into a multierror that gets returned to the caller. +// fn(cf) on each one. // Folder hierarchy is represented in its current state, and does // not contain historical data. func (c Contacts) EnumerateContainers( diff --git a/src/internal/connector/exchange/api/events.go b/src/internal/connector/exchange/api/events.go index 9d373d548..93f9eec0d 100644 --- a/src/internal/connector/exchange/api/events.go +++ b/src/internal/connector/exchange/api/events.go @@ -133,8 +133,7 @@ func (c Events) GetItem( // EnumerateContainers iterates through all of the users current // calendars, converting each to a graph.CacheFolder, and -// calling fn(cf) on each one. If fn(cf) errors, the error is -// aggregated into a multierror that gets returned to the caller. +// calling fn(cf) on each one. // Folder hierarchy is represented in its current state, and does // not contain historical data. func (c Events) EnumerateContainers( diff --git a/src/internal/connector/exchange/api/mail.go b/src/internal/connector/exchange/api/mail.go index baf1d5834..e4aee4fd8 100644 --- a/src/internal/connector/exchange/api/mail.go +++ b/src/internal/connector/exchange/api/mail.go @@ -156,8 +156,7 @@ func (c Mail) GetItem( // EnumerateContainers iterates through all of the users current // mail folders, converting each to a graph.CacheFolder, and calling -// fn(cf) on each one. If fn(cf) errors, the error is aggregated -// into a multierror that gets returned to the caller. +// fn(cf) on each one. // Folder hierarchy is represented in its current state, and does // not contain historical data. func (c Mail) EnumerateContainers( diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index feb8b9646..d1b75b603 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -469,16 +469,15 @@ func consumeBackupDataCollections( return nil, nil, nil, err } - return nil, nil, nil, errors.Wrapf( - err, - "kopia snapshot failed with %v catastrophic errors and %v ignored errors", - kopiaStats.ErrorCount, kopiaStats.IgnoredErrorCount) + return nil, nil, nil, clues.Stack(err).With( + "kopia_errors", kopiaStats.ErrorCount, + "kopia_ignored_errors", kopiaStats.IgnoredErrorCount) } if kopiaStats.ErrorCount > 0 || kopiaStats.IgnoredErrorCount > 0 { - err = errors.Errorf( - "kopia snapshot failed with %v catastrophic errors and %v ignored errors", - kopiaStats.ErrorCount, kopiaStats.IgnoredErrorCount) + err = clues.New("building kopia snapshot").With( + "kopia_errors", kopiaStats.ErrorCount, + "kopia_ignored_errors", kopiaStats.IgnoredErrorCount) } return kopiaStats, deets, itemsSourcedFromBase, err