kkerror

package module
v0.0.0-...-f6c51d7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultErrorCode = "000000"
)

Functions

This section is empty.

Types

type Category

type Category string
const (
	Server    Category = "server"
	Client    Category = "client"
	Database  Category = "database"
	Cache     Category = "cache"
	Process   Category = "process"
	Internal  Category = "internal"
	Undefined Category = "undefined"
)

type DefaultKKError

type DefaultKKError struct {
	ErrorLevel    Level    `json:"error_level,omitempty"`
	ErrorCategory Category `json:"error_category,omitempty"`
	ErrorCode     string   `json:"error_code,omitempty"` // format as 6 digits
	ErrorMessage  string   `json:"message,omitempty"`    // message
	// contains filtered or unexported fields
}

func Error

func Error(message string) *DefaultKKError

func WrappedError

func WrappedError(error KKError) *DefaultKKError

func (*DefaultKKError) Category

func (k *DefaultKKError) Category() Category

func (*DefaultKKError) Code

func (k *DefaultKKError) Code() string

func (*DefaultKKError) Error

func (k *DefaultKKError) Error() string

func (*DefaultKKError) Level

func (k *DefaultKKError) Level() Level

func (*DefaultKKError) Message

func (k *DefaultKKError) Message() string

func (*DefaultKKError) PrintStack

func (k *DefaultKKError) PrintStack()

func (*DefaultKKError) String

func (k *DefaultKKError) String() string

func (*DefaultKKError) StringStack

func (k *DefaultKKError) StringStack() string

func (*DefaultKKError) Unwrap

func (k *DefaultKKError) Unwrap() error

func (*DefaultKKError) WrappedError

func (k *DefaultKKError) WrappedError() KKError

type KKError

type KKError interface {
	error
	Level() Level
	Category() Category
	Code() string
	Message() string
	Unwrap() error
	WrappedError() KKError
}

type Level

type Level string
const (
	Critical Level = "critical"
	Urgent   Level = "urgent"
	Normal   Level = "normal"
)

Jump to

Keyboard shortcuts

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