34 lines
954 B
Go
34 lines
954 B
Go
package errs
|
|
|
|
import "errors"
|
|
|
|
// 通用错误
|
|
var (
|
|
ErrNotFound = errors.New("not found")
|
|
ErrInvalidInput = errors.New("invalid input")
|
|
ErrUnauthorized = errors.New("unauthorized")
|
|
ErrDuplicate = errors.New("duplicate")
|
|
)
|
|
|
|
// CLI 错误
|
|
var (
|
|
ErrMissingRequiredFlag = errors.New("missing required flag")
|
|
ErrInvalidFlagValue = errors.New("invalid flag value")
|
|
)
|
|
|
|
// Repository 错误
|
|
var (
|
|
ErrExecFailed = errors.New("database exec failed")
|
|
ErrQueryFailed = errors.New("database query failed")
|
|
)
|
|
|
|
// Overlay 错误
|
|
var (
|
|
ErrOverlayNotMatched = errors.New("overlay did not match")
|
|
ErrNestedOutput = errors.New("output directory must not be nested inside source directory")
|
|
ErrOutputExists = errors.New("output directory already exists")
|
|
ErrSourceNotDir = errors.New("source must be a directory")
|
|
ErrPatchFileNotFound = errors.New("patch file not found")
|
|
ErrPatchApplyFailed = errors.New("failed to apply patch")
|
|
)
|