improve language on selector reduce error (#794)
## Description shorten and consolidate the error message when the provided selectors match zero entries in the backup entity list. ## Type of change - [x] 🐹 Trivial/Minor ## Issue(s) * #564 ## Test Plan - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
d633be9eef
commit
76f2c5a632
@ -388,7 +388,7 @@ func detailsExchangeCmd(cmd *cobra.Command, args []string) error {
|
||||
|
||||
ds := sel.Reduce(ctx, d)
|
||||
if len(ds.Entries) == 0 {
|
||||
Info(ctx, "nothing to display: no items in the backup match the provided selectors")
|
||||
Info(ctx, selectors.ErrorNoMatchingItems)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ func (op *RestoreOperation) Run(ctx context.Context) (err error) {
|
||||
// format the details and retrieve the items from kopia
|
||||
fds = er.Reduce(ctx, d)
|
||||
if len(fds.Entries) == 0 {
|
||||
return errors.New("nothing to restore: no items in the backup match the provided selectors")
|
||||
return selectors.ErrorNoMatchingItems
|
||||
}
|
||||
|
||||
case selectors.ServiceOneDrive:
|
||||
|
||||
@ -21,7 +21,10 @@ const (
|
||||
ServiceOneDrive // OneDrive
|
||||
)
|
||||
|
||||
var ErrorBadSelectorCast = errors.New("wrong selector service type")
|
||||
var (
|
||||
ErrorBadSelectorCast = errors.New("wrong selector service type")
|
||||
ErrorNoMatchingItems = errors.New("no items match the specified selectors")
|
||||
)
|
||||
|
||||
const (
|
||||
scopeKeyCategory = "category"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user