apperrors

package
v0.0.0-...-9330008 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 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"
	ErrMpsOAuth2            ErrComponent = "mps oauth2"
	ErrGardenerClient       ErrComponent = "k8s client - gardener"
	ErrGardener             ErrComponent = "gardener"
	ErrClusterK8SClient     ErrComponent = "k8s client - cluster"
)

type ErrReason

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

Jump to

Keyboard shortcuts

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