localerror

package
v0.0.0-...-5bec41d Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrSvcCodeDuplicatedKey      = "duplicated_key"
	ErrSvcCodeForeignKeyViolated = "foreign_key_violation"
	ErrSvcCodeRecordNotFound     = "record_not_found"

	ErrSvcCodeUnregistered = "unregistered"
	ErrSvcCodeNone         = "success"
)

Variables

View Source
var (
	ErrAuthentication = errors.New("authentication_error")
	ErrBadJson        = errors.New("bad_json")
	ErrBadHierarchy   = errors.New("bad_hierarchy")
	ErrAlreadyMax     = errors.New("already_max")
	ErrIdNotInteger   = errors.New("id_not_integer")
	ErrBadQueryParam  = errors.New("bad_query_param")
	ErrHttpClient     = errors.New("http_client_error")
	ErrBadInput       = errors.New("bad_input")
)

Functions

This section is empty.

Types

type CodePair

type CodePair struct {
	HttpStatusCode   int
	ServiceErrorCode string
}

func NewCodePair

func NewCodePair(httpStatusCode int, serviceErrorCode string) CodePair

type Service

type Service struct {
}

func NewService

func NewService(cfg *config.Service) *Service

func (*Service) Map

func (s *Service) Map(err error) StatusInfo

type StatusInfo

type StatusInfo struct {
	HttpStatusCode      int
	ServiceErrorCode    string
	ServiceErrorMessage string
}

func NewStatusInfo

func NewStatusInfo(httpStatusCode int, serviceErrorCode string, serviceErrorMessage string) StatusInfo

Jump to

Keyboard shortcuts

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