errors

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound      = errors.New("user not found")
	ErrUserAlreadyExists = errors.New("user already exists")
	ErrUserIsSystemAdmin = errors.New("system admin account cannot be modified")
	ErrInvalidAccessKey  = errors.New("invalid access key")
	ErrInvalidSecretKey  = errors.New("invalid secret key")
	ErrInvalidStatus     = errors.New("invalid status")
)

User errors

View Source
var (
	ErrPolicyNotFound      = errors.New("policy not found")
	ErrPolicyAlreadyExists = errors.New("policy already exists")
	ErrPolicyIsBuiltin     = errors.New("built-in policy cannot be deleted")
	ErrInvalidPolicyName   = errors.New("invalid policy name")
	ErrInvalidPolicyDoc    = errors.New("invalid policy document")
)

Policy errors

View Source
var (
	ErrGroupNotFound      = errors.New("group not found")
	ErrGroupAlreadyExists = errors.New("group already exists")
	ErrInvalidGroupName   = errors.New("invalid group name")
)

Group errors

View Source
var (
	ErrServiceAccountNotFound      = errors.New("service account not found")
	ErrServiceAccountAlreadyExists = errors.New("service account already exists")
)

Service account errors

View Source
var (
	ErrBucketNotFound      = errors.New("bucket not found")
	ErrBucketAlreadyExists = errors.New("bucket already exists")
	ErrBucketNotEmpty      = errors.New("bucket not empty")
	ErrInvalidBucketName   = errors.New("invalid bucket name")
	ErrObjectNotFound      = errors.New("object not found")
	ErrInvalidObjectKey    = errors.New("invalid object key")
)

S3 errors (buckets and objects)

Functions

func IsAlreadyExists

func IsAlreadyExists(err error) bool

IsAlreadyExists checks if an error is an "already exists" error

func IsNotFound

func IsNotFound(err error) bool

IsNotFound checks if an error is a "not found" error

func IsValidation

func IsValidation(err error) bool

IsValidation checks if an error is a validation error

Types

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a field-specific validation error

func NewValidationError

func NewValidationError(field, message string) *ValidationError

NewValidationError creates a new validation error

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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