mirror of
https://github.com/kopia/kopia.git
synced 2026-01-23 13:58:08 -05:00
- nit: re-group struct fields - nit: use consts - nit: remove unnecessary fmt.Errorf(...) usage - nit: avoid unnecessarily calling defaultActionControls when there is already a value - robustness: increase readability in actions map declaration - Prefer named functions over closures for the actions. - nit fix typo - nit: simplify robustness Log.StringThisRun Iterates only over the tail of the slice, which avoids iterating over the entire slice
30 lines
934 B
Go
30 lines
934 B
Go
//go:build darwin || (linux && amd64)
|
|
// +build darwin linux,amd64
|
|
|
|
package robustness
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var (
|
|
// ErrNoOp is thrown when an action could not do anything useful.
|
|
ErrNoOp = errors.New("no-op")
|
|
|
|
// ErrCannotPerformIO is returned if the engine determines there is not enough space
|
|
// to write files.
|
|
ErrCannotPerformIO = errors.New("cannot perform i/o")
|
|
|
|
// ErrNoActionPicked is returned if a random action could not be selected.
|
|
ErrNoActionPicked = errors.New("unable to pick an action with the action control options provided")
|
|
|
|
// ErrInvalidOption is returned if an option value is invalid or missing.
|
|
ErrInvalidOption = errors.New("invalid option setting")
|
|
|
|
// ErrKeyNotFound is returned when the store can't find the key provided.
|
|
ErrKeyNotFound = errors.New("key not found")
|
|
|
|
// ErrMetadataMissing is returned when the metadata can't be found.
|
|
ErrMetadataMissing = errors.New("metadata missing")
|
|
)
|