apperrors

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

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// NotFoundMsg is the error message for NotFound errors.
	NotFoundMsg = "Object not found"
	// NotFoundMsgF is the error message format for NotFound errors.
	NotFoundMsgF = "Object not found: %s"
	// InvalidDataMsg is the error message for InvalidData errors.
	InvalidDataMsg = "Invalid data"
	// InternalServerErrMsgF is the error message format for InternalServer errors.
	InternalServerErrMsgF = "Internal Server Error: %s"
	// NotUniqueMsg is the error message for NotUnique errors.
	NotUniqueMsg = "Object is not unique"
	// NotUniqueMsgF is the error message format for NotUnique errors with custom message.
	NotUniqueMsgF = "Object is not unique: %s"
	// TenantRequiredMsg is the error message for TenantRequired errors.
	TenantRequiredMsg = "Tenant is required"
	// TenantNotFoundMsg is the error message for TenantNotFound errors.
	TenantNotFoundMsg = "Tenant not found"
	// InsufficientScopesMsg is the error message for InsufficientScopes errors.
	InsufficientScopesMsg = "insufficient scopes provided"
	// NoScopesInContextMsg is the error message for NoScopesInContext errors.
	NoScopesInContextMsg = "cannot read scopes from context"
	// NoRequiredScopesInContextMsg is the error message for NoRequiredScopesInContext errors.
	NoRequiredScopesInContextMsg = "required scopes are not defined"
	// KeyDoesNotExistMsg is the error message for KeyDoesNotExist errors.
	KeyDoesNotExistMsg = "the key does not exist in the source object"
	// CannotReadTenantMsg is the error message for CannotReadTenant errors.
	CannotReadTenantMsg = "cannot read tenant from context"
	// CannotReadClientUserMsg is the error message for CannotReadClientUser errors.
	CannotReadClientUserMsg = "cannot read client_user from context"
	// InvalidOperationMsg is the error message for InvalidOperation errors.
	InvalidOperationMsg = "The operation is not allowed"
	// UnauthorizedMsg is the error message for Unauthorized errors.
	UnauthorizedMsg = "Unauthorized"
	// OperationTimeoutMsg is the error message for Timeout errors.
	OperationTimeoutMsg = "operation has timed out"
	// EmptyDataMsg is the error message for EmptyData errors.
	EmptyDataMsg = "Some required data was left out"
	// InconsistentDataMsg is the error message for InconsistentData errors.
	InconsistentDataMsg = "Inconsistent or out-of-range data"
	// NotUniqueNameMsg is the error message for NotUniqueName errors.
	NotUniqueNameMsg = "Object name is not unique"
	// ConcurrentOperationMsg is the error message for ConcurrentOperation errors.
	ConcurrentOperationMsg = "Concurrent operation"
	// InvalidStatusConditionMsg is the error message for InvalidStatusCondition errors.
	InvalidStatusConditionMsg = "Invalid status condition"
	// CannotUpdateObjectInManyBundlesMsg is the error message for CannotUpdateObjectInManyBundles errors.
	CannotUpdateObjectInManyBundlesMsg = "Can not update object that is part of more than one bundle"
	// ConcurrentUpdateMsg is the error message for NewConcurrentUpdate errors.
	ConcurrentUpdateMsg = "Could not update object due to concurrent update"
	// ShouldUpdateSingleRowButUpdatedMsgF  is the error message for ShouldUpdateSingleRowButUpdated errors.
	ShouldUpdateSingleRowButUpdatedMsgF = "should update single row, but updated %d rows"
	// ShouldUpsertSingleRowButUpsertedMsgF  is the error message returned when upsert resulted in rows affected count not equal to 1.
	ShouldUpsertSingleRowButUpsertedMsgF = "should upsert single row, but upserted %d rows"
	// ShouldBeOwnerMsg is the error message for unauthorized due to missing owner access errors.
	ShouldBeOwnerMsg = "Owner access is needed for resource modification"
	// CannotUnassignObjectFromASA  is the error message returned when trying to unassign a Runtime Context that comes from an ASA.
	CannotUnassignObjectFromASA = "Cannot unassign object with ID coming from ASA"
	// NoScheduledOperationsMsg  is the error message returned when there are no sheduled operations currently in the priority queue.
	NoScheduledOperationsMsg = "No scheduled operations"
	// OperationInProgressMsg  is the error message returned when try to schedule the operation that is in IN_PROGRESS status.
	OperationInProgressMsg = "Operation with id %q is in IN_PROGRESS status"
)

Variables

This section is empty.

Functions

func InternalErrorFrom

func InternalErrorFrom(err error, msg string, args ...interface{}) error

InternalErrorFrom missing godoc

func IsCannotReadTenant

func IsCannotReadTenant(err error) bool

IsCannotReadTenant missing godoc

func IsCannotUnassignObjectComingFromASAError

func IsCannotUnassignObjectComingFromASAError(err error) bool

IsCannotUnassignObjectComingFromASAError missing godoc

func IsCannotUpdateObjectInManyBundlesError

func IsCannotUpdateObjectInManyBundlesError(err error) bool

IsCannotUpdateObjectInManyBundlesError missing godoc

func IsConcurrentUpdate

func IsConcurrentUpdate(err error) bool

IsConcurrentUpdate indicates if the provided error is thrown in case of concurrent update

func IsEmptyParentIDError

func IsEmptyParentIDError(err error) bool

IsEmptyParentIDError checks if the error code is EmptyParentID

func IsInvalidStatusCondition

func IsInvalidStatusCondition(err error) bool

IsInvalidStatusCondition missing godoc

func IsKeyDoesNotExist

func IsKeyDoesNotExist(err error) bool

IsKeyDoesNotExist missing godoc

func IsNewCheckViolationError

func IsNewCheckViolationError(err error) bool

IsNewCheckViolationError missing godoc

func IsNewInvalidOperationError

func IsNewInvalidOperationError(err error) bool

IsNewInvalidOperationError missing godoc

func IsNewNotNullViolationError

func IsNewNotNullViolationError(err error) bool

IsNewNotNullViolationError missing godoc

func IsNoScheduledOperationsError

func IsNoScheduledOperationsError(err error) bool

IsNoScheduledOperationsError checks if the error code is NoScheduledOperations

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError missing godoc

func IsNotUniqueError

func IsNotUniqueError(err error) bool

IsNotUniqueError missing godoc

func IsOperationInProgressError

func IsOperationInProgressError(err error) bool

IsOperationInProgressError checks if the error code is OperationInProgress

func IsTenantNotFoundError

func IsTenantNotFoundError(err error) bool

IsTenantNotFoundError missing godoc

func IsTenantRequired

func IsTenantRequired(err error) bool

IsTenantRequired missing godoc

func IsUnauthorizedError

func IsUnauthorizedError(err error) bool

IsUnauthorizedError missing godoc

func IsValueNotFoundInConfiguration

func IsValueNotFoundInConfiguration(err error) bool

IsValueNotFoundInConfiguration missing godoc

func NewCannotReadClientUserError

func NewCannotReadClientUserError() error

NewCannotReadClientUserError missing godoc

func NewCannotReadTenantError

func NewCannotReadTenantError() error

NewCannotReadTenantError missing godoc

func NewCannotUnassignObjectComingFromASAError

func NewCannotUnassignObjectComingFromASAError(objectID string) error

NewCannotUnassignObjectComingFromASAError returns CannotUnassignRuntimeContextComingFromASAError error

func NewCannotUpdateObjectInManyBundles

func NewCannotUpdateObjectInManyBundles() error

NewCannotUpdateObjectInManyBundles missing godoc

func NewCheckViolationError

func NewCheckViolationError(resourceType resource.Type) error

NewCheckViolationError missing godoc

func NewConcurrentOperationInProgressError

func NewConcurrentOperationInProgressError(msg string) error

NewConcurrentOperationInProgressError missing godoc

func NewConcurrentUpdate

func NewConcurrentUpdate() error

NewConcurrentUpdate returns ConcurrentUpdate error

func NewCustomErrorWithCode

func NewCustomErrorWithCode(code int, msg string) error

NewCustomErrorWithCode returns Error with a given code and message

func NewEmptyParentIDErrorWithMessage

func NewEmptyParentIDErrorWithMessage(message string) error

NewEmptyParentIDErrorWithMessage returns EmptyParentIDErrorWithMessage error

func NewForeignKeyInvalidOperationError

func NewForeignKeyInvalidOperationError(sqlOperation resource.SQLOperation, resourceType resource.Type) error

NewForeignKeyInvalidOperationError missing godoc

func NewInsufficientScopesError

func NewInsufficientScopesError(requiredScopes, actualScopes []string) error

NewInsufficientScopesError missing godoc

func NewInternalError

func NewInternalError(msg string, args ...interface{}) error

NewInternalError missing godoc

func NewInvalidDataError

func NewInvalidDataError(msg string, args ...interface{}) error

NewInvalidDataError missing godoc

func NewInvalidDataErrorWithFields

func NewInvalidDataErrorWithFields(fields map[string]error, objType string) error

NewInvalidDataErrorWithFields missing godoc

func NewInvalidOperationError

func NewInvalidOperationError(reason string) error

NewInvalidOperationError missing godoc

func NewInvalidStatusCondition

func NewInvalidStatusCondition(resourceType resource.Type) error

NewInvalidStatusCondition missing godoc

func NewKeyDoesNotExistError

func NewKeyDoesNotExistError(key string) error

NewKeyDoesNotExistError missing godoc

func NewNoScheduledOperationsError

func NewNoScheduledOperationsError() error

NewNoScheduledOperationsError missing godoc

func NewNoScopesInContextError

func NewNoScopesInContextError() error

NewNoScopesInContextError missing godoc

func NewNotFoundError

func NewNotFoundError(resourceType resource.Type, objectID string) error

NewNotFoundError missing godoc

func NewNotFoundErrorWithMessage

func NewNotFoundErrorWithMessage(resourceType resource.Type, objectID string, message string) error

NewNotFoundErrorWithMessage missing godoc

func NewNotFoundErrorWithType

func NewNotFoundErrorWithType(resourceType resource.Type) error

NewNotFoundErrorWithType missing godoc

func NewNotNullViolationError

func NewNotNullViolationError(resourceType resource.Type) error

NewNotNullViolationError missing godoc

func NewNotUniqueError

func NewNotUniqueError(resourceType resource.Type) error

NewNotUniqueError missing godoc

func NewNotUniqueErrorWithMessage

func NewNotUniqueErrorWithMessage(resourceType resource.Type, message string) error

NewNotUniqueErrorWithMessage constructs a new NotUniqueError with a custom message

func NewNotUniqueNameError

func NewNotUniqueNameError(resourceType resource.Type) error

NewNotUniqueNameError missing godoc

func NewOperationInProgressError

func NewOperationInProgressError(operationID string) error

NewOperationInProgressError missing godoc

func NewOperationTimeoutError

func NewOperationTimeoutError() error

NewOperationTimeoutError missing godoc

func NewRequiredScopesNotDefinedError

func NewRequiredScopesNotDefinedError() error

NewRequiredScopesNotDefinedError missing godoc

func NewTenantNotFoundError

func NewTenantNotFoundError(externalTenant string) error

NewTenantNotFoundError missing godoc

func NewTenantRequiredError

func NewTenantRequiredError() error

NewTenantRequiredError missing godoc

func NewUnauthorizedError

func NewUnauthorizedError(msg string) error

NewUnauthorizedError missing godoc

func NewValueNotFoundInConfigurationError

func NewValueNotFoundInConfigurationError() error

NewValueNotFoundInConfigurationError missing godoc

func WriteAppError

func WriteAppError(ctx context.Context, w http.ResponseWriter, appErr error, statusCode int)

WriteAppError missing godoc

Types

type Error

type Error struct {
	Message string
	// contains filtered or unexported fields
}

Error missing godoc

func (Error) Error

func (e Error) Error() string

Error missing godoc

func (Error) Is

func (e Error) Is(err error) bool

Is missing godoc

type ErrorType

type ErrorType int

ErrorType represents an integer error code.

const (
	// InternalError is the error code for Internal errors.
	InternalError ErrorType = 10
	// UnknownError is the error code for Unknown errors.
	UnknownError ErrorType = 11
	// NotFound is the error code for NotFound errors.
	NotFound ErrorType = 20
	// NotUnique is the error code for NotUnique errors.
	NotUnique ErrorType = 21
	// InvalidData is the error code for InvalidData errors.
	InvalidData ErrorType = 22
	// InsufficientScopes is the error code for InsufficientScopes errors.
	InsufficientScopes ErrorType = 23
	// TenantRequired is the error code for TenantRequired errors.
	TenantRequired ErrorType = 24
	// TenantNotFound is the error code for TenantNotFound errors.
	TenantNotFound ErrorType = 25
	// Unauthorized is the error code for Unauthorized errors.
	Unauthorized ErrorType = 26
	// InvalidOperation is the error code for InvalidOperation errors.
	InvalidOperation ErrorType = 27
	// OperationTimeout is the error code for Timeout errors.
	OperationTimeout ErrorType = 28
	// EmptyData is the error code for EmptyData errors.
	EmptyData ErrorType = 29
	// InconsistentData is the error code for InconsistentData errors.
	InconsistentData ErrorType = 30
	// NotUniqueName is the error code for NotUniqueName errors.
	NotUniqueName ErrorType = 31
	// ConcurrentOperation is the error code for ConcurrentOperation errors.
	ConcurrentOperation ErrorType = 32
	// InvalidStatusCondition is the error code for InvalidStatusCondition errors.
	InvalidStatusCondition ErrorType = 33
	// CannotUpdateObjectInManyBundles is the error code for CannotUpdateObjectInManyBundles errors.
	CannotUpdateObjectInManyBundles ErrorType = 34
	// ConcurrentUpdate is the error code for ConcurrentUpdate errors.
	ConcurrentUpdate ErrorType = 35
	// EmptyParentID is the error code for EmptyParentID errors.
	EmptyParentID ErrorType = 36
	// NoScheduledOperations is the error code when there are no scheduled operations.
	NoScheduledOperations ErrorType = 37
	// OperationInProgress is the error code when the operation is in progress.
	OperationInProgress ErrorType = 38
	// BadRequest is the error code for BadRequest errors.
	BadRequest ErrorType = 400
	// Conflict is the error code for Conflict errors.
	Conflict ErrorType = 409
)

func ErrorCode

func ErrorCode(err error) ErrorType

ErrorCode missing godoc

func (ErrorType) String

func (i ErrorType) String() string

Jump to

Keyboard shortcuts

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