Documentation ¶
Index ¶
- Constants
- func BucketDoesNotExist(stderr string) bool
- func CheckKopiaErrors(err error, errorTypes []ErrorType) bool
- func FirstMatching(err error, predicate func(error) bool) error
- func IsInvalidPasswordError(err error) bool
- func IsRepoNotFoundError(err error) bool
- func RepoNotInitialized(stderr string) bool
- type ErrorType
Constants ¶
const ( ErrInvalidPasswordStr = "invalid repository password" ErrOutOfMemoryStr = "kanister-tools container ran out of memory" ErrAccessDeniedStr = "Access Denied" ErrRepoNotFoundStr = "repository not found" ErrRepoNotInitializedStr = "repository not initialized in the provided storage" ErrFilesystemRepoNotFoundStr = "no such file or directory" ErrCodeOutOfMemoryStr = "command terminated with exit code 137" ErrBucketDoesNotExistStr = "bucket doesn't exist" ErrUnableToListFromBucketStr = "unable to list from the bucket" )
Variables ¶
This section is empty.
Functions ¶
func BucketDoesNotExist ¶
BucketDoesNotExist returns true if the stderr logs contain either `bucket doesn't exist` or `bucket "<bucket_name>" does not exist` messages.
func CheckKopiaErrors ¶
CheckKopiaErrors loops through all the permitted error types and returns true on finding a match
func FirstMatching ¶
FirstMatching returns the first error that matches the predicate in a causal dependency err->Cause()->Cause() ....
func IsInvalidPasswordError ¶
IsInvalidPasswordError returns true if the error chain has `invalid repository password` error
func IsRepoNotFoundError ¶
IsRepoNotFoundError returns true if the error contains `repository not found` message
func RepoNotInitialized ¶
RepoNotInitialized returns true if the stderr logs contains `repository not initialized` for object stores or `no such file or directory` for filestore backend
Types ¶
type ErrorType ¶
type ErrorType string
const ( ErrorInvalidPassword ErrorType = ErrInvalidPasswordStr ErrorRepoNotFound ErrorType = ErrRepoNotFoundStr )