errors

package
v0.113.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
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

func BucketDoesNotExist(stderr string) bool

BucketDoesNotExist returns true if the stderr logs contain either `bucket doesn't exist` or `bucket "<bucket_name>" does not exist` messages.

func CheckKopiaErrors

func CheckKopiaErrors(err error, errorTypes []ErrorType) bool

CheckKopiaErrors loops through all the permitted error types and returns true on finding a match

func FirstMatching

func FirstMatching(err error, predicate func(error) bool) error

FirstMatching returns the first error that matches the predicate in a causal dependency err->Cause()->Cause() ....

func IsInvalidPasswordError

func IsInvalidPasswordError(err error) bool

IsInvalidPasswordError returns true if the error chain has `invalid repository password` error

func IsRepoNotFoundError

func IsRepoNotFoundError(err error) bool

IsRepoNotFoundError returns true if the error contains `repository not found` message

func RepoNotInitialized

func RepoNotInitialized(stderr string) bool

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
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL