apperrors

package
v0.0.0-...-9dbba9d Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPresenter

func NewPresenter(logger *log.Logger) *presenter

Types

type AppError

type AppError interface {
	Append(string, ...interface{}) AppError
	SetReason(ErrReason) AppError
	SetComponent(ErrComponent) AppError

	Code() ErrCode
	Cause() CauseCode
	Component() ErrComponent
	Reason() ErrReason
	Error() string
}

func BadGateway

func BadGateway(format string, a ...interface{}) AppError

func BadRequest

func BadRequest(format string, a ...interface{}) AppError

func External

func External(format string, a ...interface{}) AppError

func Forbidden

func Forbidden(format string, a ...interface{}) AppError

func Internal

func Internal(format string, a ...interface{}) AppError

func InvalidTenant

func InvalidTenant(format string, a ...interface{}) AppError

type CauseCode

type CauseCode int
const (
	Unknown        CauseCode = 10
	TenantNotFound CauseCode = 11
)

type ErrCode

type ErrCode int
const (
	CodeBadGateway ErrCode = 502
	CodeInternal   ErrCode = 500
	CodeExternal   ErrCode = 501
	CodeForbidden  ErrCode = 403
	CodeBadRequest ErrCode = 400
)

type ErrComponent

type ErrComponent string
const (
	ErrDB                      ErrComponent = "db - provisioner"
	ErrProvisionerK8SClient    ErrComponent = "k8s client - provisioner"
	ErrProvisioner             ErrComponent = "provisioner"
	ErrCompassDirectorClient   ErrComponent = "compass director client"
	ErrCompassDirector         ErrComponent = "compass director"
	ErrMpsOAuth2               ErrComponent = "mps oauth2"
	ErrCompassConnectionClient ErrComponent = "compass connection client"
	ErrCompassConnection       ErrComponent = "compass connection"
	ErrGardenerClient          ErrComponent = "k8s client - gardener"
	ErrGardener                ErrComponent = "gardener"
	ErrClusterK8SClient        ErrComponent = "k8s client - cluster"
	ErrKymaInstaller           ErrComponent = "kyma installer"
)

type ErrReason

type ErrReason string
const (
	ErrProvisionerInternal     ErrReason = "err_provisioner_internal"
	ErrProvisionerTimeout      ErrReason = "err_provisioner_timeout"
	ErrProvisionerStepNotFound ErrReason = "err_provisioner_step_not_found"

	ErrDirectorNilResponse       ErrReason = "err_director_nil_response"
	ErrDirectorRuntimeIDMismatch ErrReason = "err_director_runtime_id_mismatch"
	ErrDirectorClientGraphqlizer ErrReason = "err_director_client_graphqlizer"

	ErrCheckKymaInstallationState ErrReason = "err_check_kyma_installation_state"
	ErrTriggerKymaInstall         ErrReason = "err_trigger_kyma_install"
	ErrTriggerKymaUninstall       ErrReason = "err_trigger_kyma_uninstall"
)

Jump to

Keyboard shortcuts

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