Documentation ¶
Index ¶
- Constants
- func InternalErrorFrom(err error, msg string, args ...interface{}) error
- func IsCannotReadTenant(err error) bool
- func IsCannotUpdateObjectInManyBundlesError(err error) bool
- func IsConcurrentUpdate(err error) bool
- func IsEmptyParentIDError(err error) bool
- func IsInternalServerError(err error) bool
- func IsInvalidOperation(err error) bool
- func IsInvalidStatusCondition(err error) bool
- func IsKeyDoesNotExist(err error) bool
- func IsNewCheckViolationError(err error) bool
- func IsNewInvalidOperationError(err error) bool
- func IsNewNotNullViolationError(err error) bool
- func IsNoScheduledOperationsError(err error) bool
- func IsNotFoundError(err error) bool
- func IsNotUniqueError(err error) bool
- func IsOperationInProgressError(err error) bool
- func IsTenantNotFoundError(err error) bool
- func IsTenantRequired(err error) bool
- func IsUnauthorizedError(err error) bool
- func IsValueNotFoundInConfiguration(err error) bool
- func NewCannotReadClientUserError() error
- func NewCannotReadTenantError() error
- func NewCannotUnassignObjectComingFromASAError(objectID string) error
- func NewCannotUpdateObjectInManyBundles() error
- func NewCheckViolationError(resourceType resource.Type) error
- func NewConcurrentOperationInProgressError(msg string) error
- func NewConcurrentUpdate() error
- func NewCustomErrorWithCode(code int, msg string) error
- func NewEmptyParentIDErrorWithMessage(message string) error
- func NewForeignKeyInvalidOperationError(sqlOperation resource.SQLOperation, resourceType resource.Type) error
- func NewInsufficientScopesError(requiredScopes, actualScopes []string) error
- func NewInternalError(msg string, args ...interface{}) error
- func NewInvalidDataError(msg string, args ...interface{}) error
- func NewInvalidDataErrorWithFields(fields map[string]error, objType string) error
- func NewInvalidOperationError(reason string) error
- func NewInvalidStatusCondition(resourceType resource.Type) error
- func NewKeyDoesNotExistError(key string) error
- func NewNoScheduledOperationsError() error
- func NewNoScopesInContextError() error
- func NewNotFoundError(resourceType resource.Type, objectID string) error
- func NewNotFoundErrorWithMessage(resourceType resource.Type, objectID string, message string) error
- func NewNotFoundErrorWithType(resourceType resource.Type) error
- func NewNotNullViolationError(resourceType resource.Type) error
- func NewNotUniqueError(resourceType resource.Type) error
- func NewNotUniqueErrorWithMessage(resourceType resource.Type, message string) error
- func NewNotUniqueNameError(resourceType resource.Type) error
- func NewOperationInProgressError(operationID string) error
- func NewOperationTimeoutError() error
- func NewRequiredScopesNotDefinedError() error
- func NewTenantNotFoundError(externalTenant string) error
- func NewTenantRequiredError() error
- func NewUnauthorizedError(msg string) error
- func NewValueNotFoundInConfigurationError() error
- func WriteAppError(ctx context.Context, w http.ResponseWriter, appErr error, statusCode int)
- type Error
- type ErrorType
Constants ¶
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 = "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 ¶
InternalErrorFrom missing godoc
func IsCannotUpdateObjectInManyBundlesError ¶
IsCannotUpdateObjectInManyBundlesError missing godoc
func IsConcurrentUpdate ¶
IsConcurrentUpdate indicates if the provided error is thrown in case of concurrent update
func IsEmptyParentIDError ¶
IsEmptyParentIDError checks if the error code is EmptyParentID
func IsInternalServerError ¶
IsInternalServerError checks if the provided error is an internal server error
func IsInvalidStatusCondition ¶
IsInvalidStatusCondition missing godoc
func IsNewCheckViolationError ¶
IsNewCheckViolationError missing godoc
func IsNewInvalidOperationError ¶
IsNewInvalidOperationError missing godoc
func IsNewNotNullViolationError ¶
IsNewNotNullViolationError missing godoc
func IsNoScheduledOperationsError ¶
IsNoScheduledOperationsError checks if the error code is NoScheduledOperations
func IsOperationInProgressError ¶
IsOperationInProgressError checks if the error code is OperationInProgress
func IsTenantNotFoundError ¶
IsTenantNotFoundError missing godoc
func IsUnauthorizedError ¶
IsUnauthorizedError missing godoc
func IsValueNotFoundInConfiguration ¶
IsValueNotFoundInConfiguration missing godoc
func NewCannotReadClientUserError ¶
func NewCannotReadClientUserError() error
NewCannotReadClientUserError missing godoc
func NewCannotReadTenantError ¶
func NewCannotReadTenantError() error
NewCannotReadTenantError missing godoc
func NewCannotUnassignObjectComingFromASAError ¶
NewCannotUnassignObjectComingFromASAError returns CannotUnassignRuntimeContextComingFromASAError error
func NewCannotUpdateObjectInManyBundles ¶
func NewCannotUpdateObjectInManyBundles() error
NewCannotUpdateObjectInManyBundles missing godoc
func NewCheckViolationError ¶
NewCheckViolationError missing godoc
func NewConcurrentOperationInProgressError ¶
NewConcurrentOperationInProgressError missing godoc
func NewConcurrentUpdate ¶
func NewConcurrentUpdate() error
NewConcurrentUpdate returns ConcurrentUpdate error
func NewCustomErrorWithCode ¶
NewCustomErrorWithCode returns Error with a given code and message
func NewEmptyParentIDErrorWithMessage ¶
NewEmptyParentIDErrorWithMessage returns EmptyParentIDErrorWithMessage error
func NewForeignKeyInvalidOperationError ¶
func NewForeignKeyInvalidOperationError(sqlOperation resource.SQLOperation, resourceType resource.Type) error
NewForeignKeyInvalidOperationError missing godoc
func NewInsufficientScopesError ¶
NewInsufficientScopesError missing godoc
func NewInternalError ¶
NewInternalError missing godoc
func NewInvalidDataError ¶
NewInvalidDataError missing godoc
func NewInvalidDataErrorWithFields ¶
NewInvalidDataErrorWithFields missing godoc
func NewInvalidOperationError ¶
NewInvalidOperationError missing godoc
func NewInvalidStatusCondition ¶
NewInvalidStatusCondition missing godoc
func NewKeyDoesNotExistError ¶
NewKeyDoesNotExistError missing godoc
func NewNoScheduledOperationsError ¶
func NewNoScheduledOperationsError() error
NewNoScheduledOperationsError missing godoc
func NewNoScopesInContextError ¶
func NewNoScopesInContextError() error
NewNoScopesInContextError missing godoc
func NewNotFoundError ¶
NewNotFoundError missing godoc
func NewNotFoundErrorWithMessage ¶
NewNotFoundErrorWithMessage missing godoc
func NewNotFoundErrorWithType ¶
NewNotFoundErrorWithType missing godoc
func NewNotNullViolationError ¶
NewNotNullViolationError missing godoc
func NewNotUniqueError ¶
NewNotUniqueError missing godoc
func NewNotUniqueErrorWithMessage ¶
NewNotUniqueErrorWithMessage constructs a new NotUniqueError with a custom message
func NewNotUniqueNameError ¶
NewNotUniqueNameError missing godoc
func NewOperationInProgressError ¶
NewOperationInProgressError missing godoc
func NewOperationTimeoutError ¶
func NewOperationTimeoutError() error
NewOperationTimeoutError missing godoc
func NewRequiredScopesNotDefinedError ¶
func NewRequiredScopesNotDefinedError() error
NewRequiredScopesNotDefinedError missing godoc
func NewTenantNotFoundError ¶
NewTenantNotFoundError missing godoc
func NewTenantRequiredError ¶
func NewTenantRequiredError() error
NewTenantRequiredError missing godoc
func NewUnauthorizedError ¶
NewUnauthorizedError missing godoc
func NewValueNotFoundInConfigurationError ¶
func NewValueNotFoundInConfigurationError() error
NewValueNotFoundInConfigurationError missing godoc
func WriteAppError ¶
WriteAppError missing godoc
Types ¶
type Error ¶
type Error struct { Message string // contains filtered or unexported fields }
Error 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 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 )