srs

package
v0.27.0-beta4 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAPIError

func GetAPIError(err error) (e registrymgmtclient.ErrorRest, ok bool)

GetAPIError gets a strongly typed error from an error

func IsErr

func IsErr(err error, errCode ServiceErrorCode) bool

IsErr returns true if the error contains the errCode

Types

type Error

type Error struct {
	Err error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ServiceErrorCode

type ServiceErrorCode int
const (
	ErrCodePrefix = "SRS-MGMT"

	// Forbidden occurs when a user is not allowed to access the service
	ErrorForbidden ServiceErrorCode = 4

	// Forbidden occurs when a user or organization has reached maximum number of allowed instances
	ErrorMaxAllowedInstanceReached ServiceErrorCode = 5

	// Conflict occurs when a database constraint is violated
	ErrorConflict ServiceErrorCode = 6

	// NotFound occurs when a record is not found in the database
	ErrorNotFound ServiceErrorCode = 7

	// Validation occurs when an object fails validation
	ErrorValidation ServiceErrorCode = 8

	// General occurs when an error fails to match any other error code
	ErrorGeneral ServiceErrorCode = 9

	// NotImplemented occurs when an API REST method is not implemented in a handler
	ErrorNotImplemented ServiceErrorCode = 10

	// Unauthorized occurs when the requester is not authorized to perform the specified action
	ErrorUnauthorized ServiceErrorCode = 11

	// Unauthenticated occurs when the provided credentials cannot be validated
	ErrorUnauthenticated ServiceErrorCode = 15

	// MalformedRequest occurs when the request body cannot be read
	ErrorMalformedRequest ServiceErrorCode = 17

	// Bad Request
	ErrorBadRequest ServiceErrorCode = 21

	// Invalid Search Query
	ErrorFailedToParseSearch ServiceErrorCode = 23

	// Failed to create service account
	ErrorFailedToCreateServiceAccount ServiceErrorCode = 110

	// Failed to get service account
	ErrorFailedToGetServiceAccount ServiceErrorCode = 111

	// Failed to delete service account
	ErrorFailedToDeleteServiceAccount ServiceErrorCode = 112

	// Provider not supported
	ErrorProviderNotSupported ServiceErrorCode = 30

	// Region not supported
	ErrorRegionNotSupported ServiceErrorCode = 31

	// Invalid registry name
	ErrorMalformedName ServiceErrorCode = 32

	// Minimum field length validation
	ErrorMinimumFieldLength ServiceErrorCode = 33

	// Maximum field length validation
	ErrorMaximumFieldLength ServiceErrorCode = 34

	// Only MultiAZ is supported
	ErrorOnlyMultiAZSupported ServiceErrorCode = 35

	// registry name must be unique
	ErrorDuplicateName ServiceErrorCode = 36

	// Failure to send an error response (i.e. unable to send error response as the error can't be converted to JSON.)
	ErrorUnableToSendErrorResponse ServiceErrorCode = 1000
)

Jump to

Keyboard shortcuts

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