apperrors

package
v0.0.0-...-1c438a8 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 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 InvalidGlobalAccount

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

func NotFound

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

type CauseCode

type CauseCode int
const (
	Unknown               CauseCode = 10
	GlobalAccountNotFound CauseCode = 11
	RuntimeNotFound       CauseCode = 20
)

type ErrCode

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

type ErrComponent

type ErrComponent string
const (
	ErrCompassManager        ErrComponent = "compass manager"
	ErrCompassDirectorClient ErrComponent = "compass director client"
	ErrCompassDirector       ErrComponent = "compass director"
	ErrMpsOAuth2             ErrComponent = "mps oauth2"
)

type ErrReason

type ErrReason string
const (
	ErrCompassManagerInternal ErrReason = "err_compass_manager_internal"

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

Jump to

Keyboard shortcuts

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