watch for et errors
This commit is contained in:
parent
b4a31c08dd
commit
66f734b4db
@ -114,7 +114,7 @@ func (c Users) GetAll(ctx context.Context, errs *fault.Errors) ([]models.Userabl
|
||||
)
|
||||
|
||||
iterator := func(item any) bool {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@ -187,7 +187,7 @@ func DataCollections(
|
||||
}
|
||||
|
||||
for _, scope := range eb.Scopes() {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ func filterContainersAndFillCollections(
|
||||
et := errs.Tracker()
|
||||
|
||||
for _, c := range resolver.Items() {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
return et.Err()
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ func filterContainersAndFillCollections(
|
||||
// in the `previousPath` set, but does not exist in the current container
|
||||
// resolver (which contains all the resource owners' current containers).
|
||||
for id, p := range tombstones {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
return et.Err()
|
||||
}
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ func RestoreExchangeEvent(
|
||||
}
|
||||
|
||||
for _, attach := range attached {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ func SendMailToBackStore(
|
||||
)
|
||||
|
||||
for _, attachment := range attached {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -319,7 +319,7 @@ func RestoreExchangeDataCollections(
|
||||
}
|
||||
|
||||
for _, dc := range dcs {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -333,7 +333,7 @@ func getResources(
|
||||
et := errs.Tracker()
|
||||
|
||||
callbackFunc := func(item any) bool {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ func GetSitePages(
|
||||
}
|
||||
|
||||
for _, entry := range pages {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -237,7 +237,7 @@ func (sc *Collection) retrieveLists(
|
||||
// For each models.Listable, object is serialized and the metrics are collected.
|
||||
// The progress is objected via the passed in channel.
|
||||
for _, lst := range lists {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ func (sc *Collection) retrievePages(
|
||||
// Pageable objects are not supported in v1.0 of msgraph at this time.
|
||||
// TODO: Verify Parsable interface supported with modified-Pageable
|
||||
for _, pg := range pages {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ func DataCollections(
|
||||
)
|
||||
|
||||
for _, scope := range b.Scopes() {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ func collectLists(
|
||||
}
|
||||
|
||||
for _, tuple := range lists {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ func collectPages(
|
||||
}
|
||||
|
||||
for _, tuple := range tuples {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ func loadSiteLists(
|
||||
}
|
||||
|
||||
for _, listID := range listIDs {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ func fetchListItems(
|
||||
}
|
||||
|
||||
for _, itm := range resp.GetValue() {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -319,7 +319,7 @@ func fetchContentTypes(
|
||||
}
|
||||
|
||||
for _, cont := range resp.GetValue() {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -232,7 +232,7 @@ func RestoreListCollection(
|
||||
trace.Log(ctx, "gc:sharepoint:restoreListCollection", directory.String())
|
||||
|
||||
for {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ func RestorePageCollection(
|
||||
)
|
||||
|
||||
for {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -404,7 +404,7 @@ func (w Wrapper) RestoreMultipleItems(
|
||||
)
|
||||
|
||||
for _, itemPath := range paths {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
return nil, et.Err()
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ func verifyDistinctBases(ctx context.Context, mans []*kopia.ManifestEntry, errs
|
||||
)
|
||||
|
||||
for _, man := range mans {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -358,7 +358,7 @@ func formatDetailsForRestoration(
|
||||
)
|
||||
|
||||
for i := range fdsPaths {
|
||||
if errs.Err() != nil {
|
||||
if et.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@ -224,7 +224,7 @@ func ExampleErrors_Errs() {
|
||||
// Err() is nil
|
||||
}
|
||||
|
||||
func ExampleTracker() {
|
||||
func ExampleErrors_Tracker() {
|
||||
// It is common for Corso to run operations in parallel,
|
||||
// and for iterations to be nested within iterations. To
|
||||
// avoid mistakenly returning an error that was sourced
|
||||
@ -235,10 +235,7 @@ func ExampleTracker() {
|
||||
|
||||
err := func() error {
|
||||
for i := range items {
|
||||
// note that we check errs.Err() on every iteration,
|
||||
// not trkr.Err(). The loop should break if any
|
||||
// hard failure occurs, not just one within this loop.
|
||||
if errs.Err() != nil {
|
||||
if trkr.Err() != nil {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user