errorutils

package
v0.0.0-...-3d086f3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) string

ErrorCode returns the top level error code if the error is a ResponseError.

func HandleCredentialError

func HandleCredentialError(err error, ctx context.ProviderCallContext) error

HandleCredentialError determines if given error relates to invalid credential. If it is, the credential is invalidated. Original error is returned untouched.

func HasDenialStatusCode

func HasDenialStatusCode(err error) bool

HasDenialStatusCode returns true of the error has a status code meaning that the credential is invalid.

func IsConflictError

func IsConflictError(err error) bool

IsConflictError returns true if the error is caused by a deployment Conflict.

func IsForbiddenError

func IsForbiddenError(err error) bool

IsForbiddenError returns true if the error is caused by a forbidden error.

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError returns true if the error is caused by a not found error.

func MaybeInvalidateCredential

func MaybeInvalidateCredential(err error, ctx context.ProviderCallContext) bool

MaybeInvalidateCredential determines if given error is related to authentication/authorisation failures. If an error is related to an invalid credential, then this call will try to invalidate that credential as well.

func MaybeQuotaExceededError

func MaybeQuotaExceededError(err error) (error, bool)

MaybeQuotaExceededError returns the relevant error message and true if the error is caused by a Quota Exceeded issue.

func SimpleError

func SimpleError(err error) error

SimpleError returns an error with the "interesting" content from a ResponseError.

func StatusCode

func StatusCode(err error) int

StatusCode returns the top level status code if the error is a ResponseError.

Types

This section is empty.

Jump to

Keyboard shortcuts

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