Fixup references to sentinel error
This commit is contained in:
parent
d2253145bf
commit
0ce35f4f62
@ -12,8 +12,8 @@ import (
|
|||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
. "github.com/alcionai/corso/src/cli/print"
|
. "github.com/alcionai/corso/src/cli/print"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/idname"
|
"github.com/alcionai/corso/src/internal/common/idname"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
|
||||||
"github.com/alcionai/corso/src/internal/m365/graph"
|
"github.com/alcionai/corso/src/internal/m365/graph"
|
||||||
"github.com/alcionai/corso/src/pkg/backup"
|
"github.com/alcionai/corso/src/pkg/backup"
|
||||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||||
@ -307,7 +307,7 @@ func genericListCommand(
|
|||||||
if len(bID) > 0 {
|
if len(bID) > 0 {
|
||||||
fe, b, errs := r.GetBackupErrors(ctx, bID)
|
fe, b, errs := r.GetBackupErrors(ctx, bID)
|
||||||
if errs.Failure() != nil {
|
if errs.Failure() != nil {
|
||||||
if errors.Is(errs.Failure(), data.ErrNotFound) {
|
if errors.Is(errs.Failure(), errs.NotFound) {
|
||||||
return Only(ctx, clues.New("No backup exists with the id "+bID))
|
return Only(ctx, clues.New("No backup exists with the id "+bID))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +370,7 @@ func genericDetailsCore(
|
|||||||
d, _, errs := bg.GetBackupDetails(ctx, backupID)
|
d, _, errs := bg.GetBackupDetails(ctx, backupID)
|
||||||
// TODO: log/track recoverable errors
|
// TODO: log/track recoverable errors
|
||||||
if errs.Failure() != nil {
|
if errs.Failure() != nil {
|
||||||
if errors.Is(errs.Failure(), data.ErrNotFound) {
|
if errors.Is(errs.Failure(), errs.NotFound) {
|
||||||
return nil, clues.New("no backup exists with the id " + backupID)
|
return nil, clues.New("no backup exists with the id " + backupID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import (
|
|||||||
. "github.com/alcionai/corso/src/cli/print"
|
. "github.com/alcionai/corso/src/cli/print"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
"github.com/alcionai/corso/src/internal/common/dttm"
|
"github.com/alcionai/corso/src/internal/common/dttm"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/observe"
|
"github.com/alcionai/corso/src/internal/observe"
|
||||||
"github.com/alcionai/corso/src/pkg/control"
|
"github.com/alcionai/corso/src/pkg/control"
|
||||||
"github.com/alcionai/corso/src/pkg/export"
|
"github.com/alcionai/corso/src/pkg/export"
|
||||||
@ -93,7 +93,7 @@ func runExport(
|
|||||||
|
|
||||||
expColl, err := eo.Run(ctx)
|
expColl, err := eo.Run(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, data.ErrNotFound) {
|
if errors.Is(err, errs.NotFound) {
|
||||||
return Only(ctx, clues.New("Backup or backup details missing for id "+backupID))
|
return Only(ctx, clues.New("Backup or backup details missing for id "+backupID))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/alcionai/corso/src/cli/flags"
|
"github.com/alcionai/corso/src/cli/flags"
|
||||||
. "github.com/alcionai/corso/src/cli/print"
|
. "github.com/alcionai/corso/src/cli/print"
|
||||||
"github.com/alcionai/corso/src/cli/utils"
|
"github.com/alcionai/corso/src/cli/utils"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/pkg/count"
|
"github.com/alcionai/corso/src/pkg/count"
|
||||||
"github.com/alcionai/corso/src/pkg/selectors"
|
"github.com/alcionai/corso/src/pkg/selectors"
|
||||||
)
|
)
|
||||||
@ -114,7 +114,7 @@ func runRestore(
|
|||||||
|
|
||||||
ds, err := ro.Run(ctx)
|
ds, err := ro.Run(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, data.ErrNotFound) {
|
if errors.Is(err, errs.NotFound) {
|
||||||
return Only(ctx, clues.New("Backup or backup details missing for id "+flags.BackupIDFV))
|
return Only(ctx, clues.New("Backup or backup details missing for id "+flags.BackupIDFV))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package data
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/pkg/control"
|
"github.com/alcionai/corso/src/pkg/control"
|
||||||
"github.com/alcionai/corso/src/pkg/fault"
|
"github.com/alcionai/corso/src/pkg/fault"
|
||||||
"github.com/alcionai/corso/src/pkg/path"
|
"github.com/alcionai/corso/src/pkg/path"
|
||||||
@ -23,13 +24,13 @@ type FetchRestoreCollection struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NoFetchRestoreCollection is a wrapper for a Collection that returns
|
// NoFetchRestoreCollection is a wrapper for a Collection that returns
|
||||||
// ErrNotFound for all Fetch calls.
|
// errs.NotFound for all Fetch calls.
|
||||||
type NoFetchRestoreCollection struct {
|
type NoFetchRestoreCollection struct {
|
||||||
Collection
|
Collection
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c NoFetchRestoreCollection) FetchItemByName(context.Context, string) (Item, error) {
|
func (c NoFetchRestoreCollection) FetchItemByName(context.Context, string) (Item, error) {
|
||||||
return nil, ErrNotFound
|
return nil, errs.NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
// StateOf lets us figure out the state of the collection from the
|
// StateOf lets us figure out the state of the collection from the
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"github.com/spatialcurrent/go-lazy/pkg/lazy"
|
"github.com/spatialcurrent/go-lazy/pkg/lazy"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/readers"
|
"github.com/alcionai/corso/src/internal/common/readers"
|
||||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||||
"github.com/alcionai/corso/src/pkg/fault"
|
"github.com/alcionai/corso/src/pkg/fault"
|
||||||
@ -259,7 +260,7 @@ func (i *lazyItem) Info() (details.ItemInfo, error) {
|
|||||||
defer i.mu.Unlock()
|
defer i.mu.Unlock()
|
||||||
|
|
||||||
if i.delInFlight {
|
if i.delInFlight {
|
||||||
return details.ItemInfo{}, clues.Stack(ErrNotFound).WithClues(i.ctx)
|
return details.ItemInfo{}, clues.Stack(errs.NotFound).WithClues(i.ctx)
|
||||||
} else if i.info == nil {
|
} else if i.info == nil {
|
||||||
return details.ItemInfo{}, clues.New("requesting ItemInfo before data retrieval").
|
return details.ItemInfo{}, clues.New("requesting ItemInfo before data retrieval").
|
||||||
WithClues(i.ctx)
|
WithClues(i.ctx)
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/readers"
|
"github.com/alcionai/corso/src/internal/common/readers"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
"github.com/alcionai/corso/src/internal/tester"
|
"github.com/alcionai/corso/src/internal/tester"
|
||||||
@ -376,7 +377,7 @@ func (suite *ItemUnitSuite) TestLazyItem_DeletedInFlight() {
|
|||||||
assert.Empty(t, readData, "read data")
|
assert.Empty(t, readData, "read data")
|
||||||
|
|
||||||
_, err = item.Info()
|
_, err = item.Info()
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, "Info() error")
|
assert.ErrorIs(t, err, errs.NotFound, "Info() error")
|
||||||
|
|
||||||
e := errs.Errors()
|
e := errs.Errors()
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/readers"
|
"github.com/alcionai/corso/src/internal/common/readers"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||||
@ -144,7 +145,7 @@ func (c Collection) FetchItemByName(
|
|||||||
) (data.Item, error) {
|
) (data.Item, error) {
|
||||||
res := c.AuxItems[name]
|
res := c.AuxItems[name]
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, data.ErrNotFound
|
return nil, errs.NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
@ -163,7 +164,7 @@ func (rc RestoreCollection) FetchItemByName(
|
|||||||
) (data.Item, error) {
|
) (data.Item, error) {
|
||||||
res := rc.AuxItems[name]
|
res := rc.AuxItems[name]
|
||||||
if res == nil {
|
if res == nil {
|
||||||
return nil, data.ErrNotFound
|
return nil, errs.NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/model"
|
"github.com/alcionai/corso/src/internal/model"
|
||||||
"github.com/alcionai/corso/src/internal/tester"
|
"github.com/alcionai/corso/src/internal/tester"
|
||||||
"github.com/alcionai/corso/src/pkg/backup"
|
"github.com/alcionai/corso/src/pkg/backup"
|
||||||
@ -91,7 +91,7 @@ func (mg mockEmptyModelGetter) GetBackup(
|
|||||||
context.Context,
|
context.Context,
|
||||||
model.StableID,
|
model.StableID,
|
||||||
) (*backup.Backup, error) {
|
) (*backup.Backup, error) {
|
||||||
return nil, data.ErrNotFound
|
return nil, errs.NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@ -269,7 +269,7 @@ func (mg mockModelGetter) GetBackup(
|
|||||||
return &res, nil
|
return &res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, data.ErrNotFound
|
return nil, errs.NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import (
|
|||||||
"golang.org/x/exp/maps"
|
"golang.org/x/exp/maps"
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/model"
|
"github.com/alcionai/corso/src/internal/model"
|
||||||
"github.com/alcionai/corso/src/pkg/backup"
|
"github.com/alcionai/corso/src/pkg/backup"
|
||||||
"github.com/alcionai/corso/src/pkg/logger"
|
"github.com/alcionai/corso/src/pkg/logger"
|
||||||
@ -160,7 +160,7 @@ func cleanupOrphanedData(
|
|||||||
model.BackupSchema,
|
model.BackupSchema,
|
||||||
bup.ModelStoreID,
|
bup.ModelStoreID,
|
||||||
&bm); err != nil {
|
&bm); err != nil {
|
||||||
if !errors.Is(err, data.ErrNotFound) {
|
if !errors.Is(err, errs.NotFound) {
|
||||||
return clues.Wrap(err, "getting backup model").
|
return clues.Wrap(err, "getting backup model").
|
||||||
With("search_backup_id", bup.ID)
|
With("search_backup_id", bup.ID)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/model"
|
"github.com/alcionai/corso/src/internal/model"
|
||||||
"github.com/alcionai/corso/src/internal/tester"
|
"github.com/alcionai/corso/src/internal/tester"
|
||||||
"github.com/alcionai/corso/src/pkg/backup"
|
"github.com/alcionai/corso/src/pkg/backup"
|
||||||
@ -116,7 +116,7 @@ func (ms mockStorer) GetWithModelStoreID(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return clues.Stack(data.ErrNotFound)
|
return clues.Stack(errs.NotFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ms mockStorer) DeleteWithModelStoreIDs(
|
func (ms mockStorer) DeleteWithModelStoreIDs(
|
||||||
@ -518,11 +518,11 @@ func (suite *BackupCleanupUnitSuite) TestCleanupOrphanedData() {
|
|||||||
{bup: bupCurrent()},
|
{bup: bupCurrent()},
|
||||||
{
|
{
|
||||||
bup: bupLegacy(),
|
bup: bupLegacy(),
|
||||||
err: data.ErrNotFound,
|
err: errs.NotFound,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
bup: bupNoDetails(),
|
bup: bupNoDetails(),
|
||||||
err: data.ErrNotFound,
|
err: errs.NotFound,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Backup IDs are still included in here because they're added to the
|
// Backup IDs are still included in here because they're added to the
|
||||||
@ -623,7 +623,7 @@ func (suite *BackupCleanupUnitSuite) TestCleanupOrphanedData() {
|
|||||||
backups: []backupRes{
|
backups: []backupRes{
|
||||||
{
|
{
|
||||||
bup: backupWithTime(baseTime, bupCurrent()),
|
bup: backupWithTime(baseTime, bupCurrent()),
|
||||||
err: data.ErrNotFound,
|
err: errs.NotFound,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
time: baseTime,
|
time: baseTime,
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import (
|
|||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"github.com/kopia/kopia/fs"
|
"github.com/kopia/kopia/fs"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/readers"
|
"github.com/alcionai/corso/src/internal/common/readers"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
"github.com/alcionai/corso/src/pkg/fault"
|
"github.com/alcionai/corso/src/pkg/fault"
|
||||||
@ -74,7 +75,7 @@ func (kdc kopiaDataCollection) FullPath() path.Path {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fetch returns the file with the given name from the collection as a
|
// Fetch returns the file with the given name from the collection as a
|
||||||
// data.Item. Returns a data.ErrNotFound error if the file isn't in the
|
// data.Item. Returns a errs.NotFound error if the file isn't in the
|
||||||
// collection.
|
// collection.
|
||||||
func (kdc kopiaDataCollection) FetchItemByName(
|
func (kdc kopiaDataCollection) FetchItemByName(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
@ -93,7 +94,7 @@ func (kdc kopiaDataCollection) FetchItemByName(
|
|||||||
e, err := kdc.dir.Child(ctx, encodeAsPath(name))
|
e, err := kdc.dir.Child(ctx, encodeAsPath(name))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if isErrEntryNotFound(err) {
|
if isErrEntryNotFound(err) {
|
||||||
err = clues.Stack(data.ErrNotFound, err)
|
err = clues.Stack(errs.NotFound, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, clues.Wrap(err, "getting item").WithClues(ctx)
|
return nil, clues.Wrap(err, "getting item").WithClues(ctx)
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/readers"
|
"github.com/alcionai/corso/src/internal/common/readers"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
dataMock "github.com/alcionai/corso/src/internal/data/mock"
|
dataMock "github.com/alcionai/corso/src/internal/data/mock"
|
||||||
@ -410,7 +411,7 @@ func (suite *KopiaDataCollectionUnitSuite) TestFetchItemByName() {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if test.notFoundErr {
|
if test.notFoundErr {
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, clues.ToCore(err))
|
assert.ErrorIs(t, err, errs.NotFound, clues.ToCore(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import (
|
|||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
"github.com/alcionai/corso/src/pkg/fault"
|
"github.com/alcionai/corso/src/pkg/fault"
|
||||||
"github.com/alcionai/corso/src/pkg/logger"
|
"github.com/alcionai/corso/src/pkg/logger"
|
||||||
@ -92,7 +93,7 @@ func (mc *mergeCollection) Items(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fetch goes through all the collections in this one and returns the first
|
// Fetch goes through all the collections in this one and returns the first
|
||||||
// match found or the first error that is not data.ErrNotFound. If multiple
|
// match found or the first error that is not errs.NotFound. If multiple
|
||||||
// collections have the requested item, the instance in the collection with the
|
// collections have the requested item, the instance in the collection with the
|
||||||
// lexicographically smallest storage path is returned.
|
// lexicographically smallest storage path is returned.
|
||||||
func (mc *mergeCollection) FetchItemByName(
|
func (mc *mergeCollection) FetchItemByName(
|
||||||
@ -113,11 +114,11 @@ func (mc *mergeCollection) FetchItemByName(
|
|||||||
s, err := c.FetchItemByName(ictx, name)
|
s, err := c.FetchItemByName(ictx, name)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return s, nil
|
return s, nil
|
||||||
} else if err != nil && !errors.Is(err, data.ErrNotFound) {
|
} else if err != nil && !errors.Is(err, errs.NotFound) {
|
||||||
return nil, clues.Wrap(err, "fetching from merged collection").
|
return nil, clues.Wrap(err, "fetching from merged collection").
|
||||||
WithClues(ictx)
|
WithClues(ictx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, clues.Wrap(data.ErrNotFound, "merged collection fetch")
|
return nil, clues.Wrap(errs.NotFound, "merged collection fetch")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/readers"
|
"github.com/alcionai/corso/src/internal/common/readers"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
"github.com/alcionai/corso/src/internal/m365/service/exchange/mock"
|
"github.com/alcionai/corso/src/internal/m365/service/exchange/mock"
|
||||||
@ -292,7 +293,7 @@ func (suite *MergeCollectionUnitSuite) TestFetchItemByName() {
|
|||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if test.notFoundErr {
|
if test.notFoundErr {
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, clues.ToCore(err))
|
assert.ErrorIs(t, err, errs.NotFound, clues.ToCore(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"golang.org/x/exp/maps"
|
"golang.org/x/exp/maps"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/model"
|
"github.com/alcionai/corso/src/internal/model"
|
||||||
"github.com/alcionai/corso/src/pkg/store"
|
"github.com/alcionai/corso/src/pkg/store"
|
||||||
)
|
)
|
||||||
@ -292,7 +292,7 @@ func (ms *ModelStore) getModelStoreID(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(metadata) == 0 {
|
if len(metadata) == 0 {
|
||||||
return "", clues.Wrap(data.ErrNotFound, "getting ModelStoreID").WithClues(ctx)
|
return "", clues.Wrap(errs.NotFound, "getting ModelStoreID").WithClues(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(metadata) != 1 {
|
if len(metadata) != 1 {
|
||||||
@ -347,7 +347,7 @@ func (ms *ModelStore) GetWithModelStoreID(
|
|||||||
metadata, err := ms.c.GetManifest(ctx, id, m)
|
metadata, err := ms.c.GetManifest(ctx, id, m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, manifest.ErrNotFound) {
|
if errors.Is(err, manifest.ErrNotFound) {
|
||||||
err = data.ErrNotFound
|
err = errs.NotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
return clues.Wrap(err, "getting model data").WithClues(ctx)
|
return clues.Wrap(err, "getting model data").WithClues(ctx)
|
||||||
@ -490,7 +490,7 @@ func (ms *ModelStore) Delete(ctx context.Context, s model.Schema, id model.Stabl
|
|||||||
|
|
||||||
latest, err := ms.getModelStoreID(ctx, s, id)
|
latest, err := ms.getModelStoreID(ctx, s, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, data.ErrNotFound) {
|
if errors.Is(err, errs.NotFound) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/model"
|
"github.com/alcionai/corso/src/internal/model"
|
||||||
"github.com/alcionai/corso/src/internal/tester"
|
"github.com/alcionai/corso/src/internal/tester"
|
||||||
"github.com/alcionai/corso/src/pkg/backup"
|
"github.com/alcionai/corso/src/pkg/backup"
|
||||||
@ -381,10 +381,10 @@ func (suite *ModelStoreIntegrationSuite) TestGet_NotFoundErrors() {
|
|||||||
t := suite.T()
|
t := suite.T()
|
||||||
|
|
||||||
err := suite.m.Get(suite.ctx, model.BackupOpSchema, "baz", nil)
|
err := suite.m.Get(suite.ctx, model.BackupOpSchema, "baz", nil)
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, clues.ToCore(err))
|
assert.ErrorIs(t, err, errs.NotFound, clues.ToCore(err))
|
||||||
|
|
||||||
err = suite.m.GetWithModelStoreID(suite.ctx, model.BackupOpSchema, "baz", nil)
|
err = suite.m.GetWithModelStoreID(suite.ctx, model.BackupOpSchema, "baz", nil)
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, clues.ToCore(err))
|
assert.ErrorIs(t, err, errs.NotFound, clues.ToCore(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ModelStoreIntegrationSuite) TestPutGetOfTypeBadVersion() {
|
func (suite *ModelStoreIntegrationSuite) TestPutGetOfTypeBadVersion() {
|
||||||
@ -670,7 +670,7 @@ func (suite *ModelStoreIntegrationSuite) TestPutUpdate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
err = m.GetWithModelStoreID(ctx, theModelType, oldModelID, nil)
|
err = m.GetWithModelStoreID(ctx, theModelType, oldModelID, nil)
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, clues.ToCore(err))
|
assert.ErrorIs(t, err, errs.NotFound, clues.ToCore(err))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -737,7 +737,7 @@ func (suite *ModelStoreIntegrationSuite) TestPutDelete() {
|
|||||||
|
|
||||||
returned := &fooModel{}
|
returned := &fooModel{}
|
||||||
err = suite.m.GetWithModelStoreID(suite.ctx, theModelType, foo.ModelStoreID, returned)
|
err = suite.m.GetWithModelStoreID(suite.ctx, theModelType, foo.ModelStoreID, returned)
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, clues.ToCore(err))
|
assert.ErrorIs(t, err, errs.NotFound, clues.ToCore(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ModelStoreIntegrationSuite) TestPutDeleteBatch() {
|
func (suite *ModelStoreIntegrationSuite) TestPutDeleteBatch() {
|
||||||
@ -760,7 +760,7 @@ func (suite *ModelStoreIntegrationSuite) TestPutDeleteBatch() {
|
|||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
returned := &fooModel{}
|
returned := &fooModel{}
|
||||||
err := suite.m.GetWithModelStoreID(suite.ctx, theModelType, id, returned)
|
err := suite.m.GetWithModelStoreID(suite.ctx, theModelType, id, returned)
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, clues.ToCore(err))
|
assert.ErrorIs(t, err, errs.NotFound, clues.ToCore(err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -843,7 +843,7 @@ func (suite *ModelStoreRegressionSuite) TestFailDuringWriteSessionHasNoVisibleEf
|
|||||||
assert.ErrorIs(t, err, assert.AnError, clues.ToCore(err))
|
assert.ErrorIs(t, err, assert.AnError, clues.ToCore(err))
|
||||||
|
|
||||||
err = m.GetWithModelStoreID(ctx, theModelType, newID, nil)
|
err = m.GetWithModelStoreID(ctx, theModelType, newID, nil)
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, clues.ToCore(err))
|
assert.ErrorIs(t, err, errs.NotFound, clues.ToCore(err))
|
||||||
|
|
||||||
returned := &fooModel{}
|
returned := &fooModel{}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/kopia/kopia/snapshot/snapshotfs"
|
"github.com/kopia/kopia/snapshot/snapshotfs"
|
||||||
"golang.org/x/exp/maps"
|
"golang.org/x/exp/maps"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/prefixmatcher"
|
"github.com/alcionai/corso/src/internal/common/prefixmatcher"
|
||||||
"github.com/alcionai/corso/src/internal/common/ptr"
|
"github.com/alcionai/corso/src/internal/common/ptr"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
@ -133,7 +134,7 @@ func (cp *corsoProgress) FinishedFile(relativePath string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
info, err := d.infoer.Info()
|
info, err := d.infoer.Info()
|
||||||
if errors.Is(err, data.ErrNotFound) {
|
if errors.Is(err, errs.NotFound) {
|
||||||
// The item was deleted between enumeration and trying to get data. Skip
|
// The item was deleted between enumeration and trying to get data. Skip
|
||||||
// adding it to details since there's no data for it.
|
// adding it to details since there's no data for it.
|
||||||
return
|
return
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import (
|
|||||||
"github.com/kopia/kopia/snapshot/snapshotmaintenance"
|
"github.com/kopia/kopia/snapshot/snapshotmaintenance"
|
||||||
"golang.org/x/exp/maps"
|
"golang.org/x/exp/maps"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/prefixmatcher"
|
"github.com/alcionai/corso/src/internal/common/prefixmatcher"
|
||||||
"github.com/alcionai/corso/src/internal/common/readers"
|
"github.com/alcionai/corso/src/internal/common/readers"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
@ -370,7 +371,7 @@ func getDir(
|
|||||||
encodeElements(dirPath.PopFront().Elements()...))
|
encodeElements(dirPath.PopFront().Elements()...))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if isErrEntryNotFound(err) {
|
if isErrEntryNotFound(err) {
|
||||||
err = clues.Stack(data.ErrNotFound, err).WithClues(ctx)
|
err = clues.Stack(errs.NotFound, err).WithClues(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, clues.Wrap(err, "getting nested object handle").WithClues(ctx)
|
return nil, clues.Wrap(err, "getting nested object handle").WithClues(ctx)
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import (
|
|||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"golang.org/x/exp/maps"
|
"golang.org/x/exp/maps"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
pmMock "github.com/alcionai/corso/src/internal/common/prefixmatcher/mock"
|
pmMock "github.com/alcionai/corso/src/internal/common/prefixmatcher/mock"
|
||||||
"github.com/alcionai/corso/src/internal/common/ptr"
|
"github.com/alcionai/corso/src/internal/common/ptr"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
@ -1398,7 +1399,7 @@ func (suite *KopiaIntegrationSuite) TestBackupCollections_ReaderError() {
|
|||||||
// Files that had an error shouldn't make a dir entry in kopia. If they do we
|
// Files that had an error shouldn't make a dir entry in kopia. If they do we
|
||||||
// may run into kopia-assisted incrementals issues because only mod time and
|
// may run into kopia-assisted incrementals issues because only mod time and
|
||||||
// not file size is checked for StreamingFiles.
|
// not file size is checked for StreamingFiles.
|
||||||
assert.ErrorIs(t, errs.Failure(), data.ErrNotFound, "errored file is restorable", clues.ToCore(err))
|
assert.ErrorIs(t, errs.Failure(), errs.NotFound, "errored file is restorable", clues.ToCore(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
type backedupFile struct {
|
type backedupFile struct {
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import (
|
|||||||
"golang.org/x/exp/maps"
|
"golang.org/x/exp/maps"
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/ptr"
|
"github.com/alcionai/corso/src/internal/common/ptr"
|
||||||
"github.com/alcionai/corso/src/internal/common/readers"
|
"github.com/alcionai/corso/src/internal/common/readers"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
@ -625,7 +626,7 @@ func (suite *CollectionUnitSuite) TestLazyItem_ReturnsEmptyReaderOnDeletedInFlig
|
|||||||
assert.Empty(t, readData, "read item data")
|
assert.Empty(t, readData, "read item data")
|
||||||
|
|
||||||
_, err = li.Info()
|
_, err = li.Info()
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound, "Info() error")
|
assert.ErrorIs(t, err, errs.NotFound, "Info() error")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *CollectionUnitSuite) TestLazyItem() {
|
func (suite *CollectionUnitSuite) TestLazyItem() {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/alcionai/clues"
|
"github.com/alcionai/clues"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/data"
|
||||||
"github.com/alcionai/corso/src/internal/kopia"
|
"github.com/alcionai/corso/src/internal/kopia"
|
||||||
"github.com/alcionai/corso/src/internal/kopia/inject"
|
"github.com/alcionai/corso/src/internal/kopia/inject"
|
||||||
@ -128,7 +129,7 @@ func getManifestsAndMetadata(
|
|||||||
// should be safe to leave this manifest in the AssistBases set, though we
|
// should be safe to leave this manifest in the AssistBases set, though we
|
||||||
// could remove it there too if we want to be conservative. That can be done
|
// could remove it there too if we want to be conservative. That can be done
|
||||||
// by finding the manifest ID.
|
// by finding the manifest ID.
|
||||||
if err != nil && !errors.Is(err, data.ErrNotFound) {
|
if err != nil && !errors.Is(err, errs.NotFound) {
|
||||||
// prior metadata isn't guaranteed to exist.
|
// prior metadata isn't guaranteed to exist.
|
||||||
// if it doesn't, we'll just have to do a
|
// if it doesn't, we'll just have to do a
|
||||||
// full backup for that data.
|
// full backup for that data.
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/kopia"
|
"github.com/alcionai/corso/src/internal/kopia"
|
||||||
"github.com/alcionai/corso/src/internal/tester"
|
"github.com/alcionai/corso/src/internal/tester"
|
||||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||||
@ -207,7 +207,7 @@ func (suite *StreamStoreIntgSuite) TestStreamer() {
|
|||||||
snapid,
|
snapid,
|
||||||
DetailsReader(details.UnmarshalTo(&readDeets)),
|
DetailsReader(details.UnmarshalTo(&readDeets)),
|
||||||
fault.New(true))
|
fault.New(true))
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound)
|
assert.ErrorIs(t, err, errs.NotFound)
|
||||||
assert.Empty(t, readDeets)
|
assert.Empty(t, readDeets)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,7 +229,7 @@ func (suite *StreamStoreIntgSuite) TestStreamer() {
|
|||||||
snapid,
|
snapid,
|
||||||
FaultErrorsReader(fault.UnmarshalErrorsTo(&readErrs)),
|
FaultErrorsReader(fault.UnmarshalErrorsTo(&readErrs)),
|
||||||
fault.New(true))
|
fault.New(true))
|
||||||
assert.ErrorIs(t, err, data.ErrNotFound)
|
assert.ErrorIs(t, err, errs.NotFound)
|
||||||
assert.Empty(t, readErrs)
|
assert.Empty(t, readErrs)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import (
|
|||||||
"github.com/kopia/kopia/repo/manifest"
|
"github.com/kopia/kopia/repo/manifest"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/common/idname"
|
"github.com/alcionai/corso/src/internal/common/idname"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
|
||||||
"github.com/alcionai/corso/src/internal/kopia"
|
"github.com/alcionai/corso/src/internal/kopia"
|
||||||
"github.com/alcionai/corso/src/internal/m365/collection/drive/metadata"
|
"github.com/alcionai/corso/src/internal/m365/collection/drive/metadata"
|
||||||
"github.com/alcionai/corso/src/internal/model"
|
"github.com/alcionai/corso/src/internal/model"
|
||||||
@ -330,7 +330,7 @@ func deleteBackups(
|
|||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
b, err := sw.GetBackup(ctx, model.StableID(id))
|
b, err := sw.GetBackup(ctx, model.StableID(id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !failOnMissing && errors.Is(err, data.ErrNotFound) {
|
if !failOnMissing && errors.Is(err, errs.NotFound) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/internal/common/crash"
|
"github.com/alcionai/corso/src/internal/common/crash"
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/events"
|
"github.com/alcionai/corso/src/internal/events"
|
||||||
"github.com/alcionai/corso/src/internal/kopia"
|
"github.com/alcionai/corso/src/internal/kopia"
|
||||||
"github.com/alcionai/corso/src/internal/model"
|
"github.com/alcionai/corso/src/internal/model"
|
||||||
@ -385,7 +385,7 @@ func newRepoID(s storage.Storage) string {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
func errWrapper(err error) error {
|
func errWrapper(err error) error {
|
||||||
if errors.Is(err, data.ErrNotFound) {
|
if errors.Is(err, errs.NotFound) {
|
||||||
return clues.Stack(ErrorBackupNotFound, err)
|
return clues.Stack(ErrorBackupNotFound, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
"github.com/alcionai/corso/src/internal/data"
|
"github.com/alcionai/corso/src/internal/common/errs"
|
||||||
"github.com/alcionai/corso/src/internal/kopia"
|
"github.com/alcionai/corso/src/internal/kopia"
|
||||||
"github.com/alcionai/corso/src/internal/model"
|
"github.com/alcionai/corso/src/internal/model"
|
||||||
"github.com/alcionai/corso/src/internal/operations"
|
"github.com/alcionai/corso/src/internal/operations"
|
||||||
@ -107,11 +107,11 @@ func (suite *RepositoryBackupsUnitSuite) TestGetBackup() {
|
|||||||
name: "get error",
|
name: "get error",
|
||||||
sw: mock.BackupWrapper{
|
sw: mock.BackupWrapper{
|
||||||
Backup: bup,
|
Backup: bup,
|
||||||
GetErr: data.ErrNotFound,
|
GetErr: errs.NotFound,
|
||||||
DeleteErr: nil,
|
DeleteErr: nil,
|
||||||
},
|
},
|
||||||
expectErr: func(t *testing.T, result error) {
|
expectErr: func(t *testing.T, result error) {
|
||||||
assert.ErrorIs(t, result, data.ErrNotFound, clues.ToCore(result))
|
assert.ErrorIs(t, result, errs.NotFound, clues.ToCore(result))
|
||||||
assert.ErrorIs(t, result, ErrorBackupNotFound, clues.ToCore(result))
|
assert.ErrorIs(t, result, ErrorBackupNotFound, clues.ToCore(result))
|
||||||
},
|
},
|
||||||
expectID: bup.ID,
|
expectID: bup.ID,
|
||||||
@ -446,14 +446,14 @@ func (suite *RepositoryBackupsUnitSuite) TestDeleteBackups() {
|
|||||||
bup.ID,
|
bup.ID,
|
||||||
},
|
},
|
||||||
gets: []getRes{
|
gets: []getRes{
|
||||||
{err: data.ErrNotFound},
|
{err: errs.NotFound},
|
||||||
},
|
},
|
||||||
expectGets: []model.StableID{
|
expectGets: []model.StableID{
|
||||||
bup.ID,
|
bup.ID,
|
||||||
},
|
},
|
||||||
failOnMissing: true,
|
failOnMissing: true,
|
||||||
expectErr: func(t *testing.T, result error) {
|
expectErr: func(t *testing.T, result error) {
|
||||||
assert.ErrorIs(t, result, data.ErrNotFound, clues.ToCore(result))
|
assert.ErrorIs(t, result, errs.NotFound, clues.ToCore(result))
|
||||||
assert.ErrorIs(t, result, ErrorBackupNotFound, clues.ToCore(result))
|
assert.ErrorIs(t, result, ErrorBackupNotFound, clues.ToCore(result))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -598,7 +598,7 @@ func (suite *RepositoryBackupsUnitSuite) TestDeleteBackups() {
|
|||||||
{bup: bup},
|
{bup: bup},
|
||||||
{bup: bupLegacy},
|
{bup: bupLegacy},
|
||||||
{bup: bupNoSnapshot},
|
{bup: bupNoSnapshot},
|
||||||
{err: data.ErrNotFound},
|
{err: errs.NotFound},
|
||||||
},
|
},
|
||||||
expectGets: []model.StableID{
|
expectGets: []model.StableID{
|
||||||
bup.ID,
|
bup.ID,
|
||||||
@ -608,7 +608,7 @@ func (suite *RepositoryBackupsUnitSuite) TestDeleteBackups() {
|
|||||||
},
|
},
|
||||||
failOnMissing: true,
|
failOnMissing: true,
|
||||||
expectErr: func(t *testing.T, result error) {
|
expectErr: func(t *testing.T, result error) {
|
||||||
assert.ErrorIs(t, result, data.ErrNotFound, clues.ToCore(result))
|
assert.ErrorIs(t, result, errs.NotFound, clues.ToCore(result))
|
||||||
assert.ErrorIs(t, result, ErrorBackupNotFound, clues.ToCore(result))
|
assert.ErrorIs(t, result, ErrorBackupNotFound, clues.ToCore(result))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -622,7 +622,7 @@ func (suite *RepositoryBackupsUnitSuite) TestDeleteBackups() {
|
|||||||
},
|
},
|
||||||
gets: []getRes{
|
gets: []getRes{
|
||||||
{bup: bup},
|
{bup: bup},
|
||||||
{err: data.ErrNotFound},
|
{err: errs.NotFound},
|
||||||
{bup: bupNoSnapshot},
|
{bup: bupNoSnapshot},
|
||||||
{bup: bupNoDetails},
|
{bup: bupNoDetails},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user