objerr

package
v3.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package objerr provides error definitions used in 'objstore'.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnauthenticated is returned if we've sent a request to a cloud provider and received a response indicating
	// that we're unauthenticated i.e. 401 for Azure and typically a 403 for AWS.
	ErrUnauthenticated = errors.New("failed to authenticate, please check that valid credentials have been provided")

	// ErrUnauthorized is returned if we've successfully authenticated against the cloud provider, however, we've
	// attempted an operation where we don't have the valid permissions. This is typically a result of not having the
	// correct RBAC permissions.
	ErrUnauthorized = errors.New("authenticated user does not have the permission to access this resource")
)
View Source
var ErrEndpointResolutionFailed = errors.New("cloud endpoint domain name resolution failed, " +
	"check account name/region and endpoint are all valid")

ErrEndpointResolutionFailed is returned if we've failed to resolve the cloud endpoint for some reason.

View Source
var ErrNoCredentialsFound = errors.New("could not find credentials for the supported authentication methods")

ErrNoValidCredentialsFound is returned if we have checked all of the supported authentication methods and could not create any credentials.

NOTE: This error specifically means that we couldn't find/create any credentials, if a credential is found and ends up being invalid, a different error will be returned.

View Source
var ErrUnsupportedOperation = errors.New("unsupported operation")

ErrUnsupportedOperation is returned when attempting to perform an operation which is unsupported for the current cloud provider.

Functions

func HandleError

func HandleError(err error) error

HandleError converts the given error into a user friendly error where possible, returning the given error when not.

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError return a boolean indicating whether the given error is a 'NotFoundError'.

func TryHandleError

func TryHandleError(err error) error

TryHandleError converts the given error into a user friendly error where possible, returning <nil> where not.

Types

type NotFoundError

type NotFoundError struct {
	Type string
	Name string
}

NotFoundError indicates that something was not found.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the 'error' interface.

Jump to

Keyboard shortcuts

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