yaperror

package
v0.0.0-...-ee9a62b Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorOptions

type ErrorOptions struct {
	Message string
	Extra   map[string]interface{}
}

type Options

type Options func(*ErrorOptions)

func WithExra

func WithExra(extra map[string]interface{}) Options

func WithMessage

func WithMessage(msg string) Options

type YAPSError

type YAPSError struct {
	Code    YapsError
	Message string
	Err     error
	Extra   map[string]interface{}
}

func Error

func Error(errType YapsError, err error, options ...Options) *YAPSError

func (*YAPSError) Error

func (e *YAPSError) Error() string

func (*YAPSError) ErrorCode

func (e *YAPSError) ErrorCode() string

func (*YAPSError) ZapError

func (e *YAPSError) ZapError(logger *zap.Logger)

type YapsError

type YapsError int
const (
	UNKNOW YapsError = iota
	FILE_NOT_FOUND
	FILE_CREATE_INTERFACE
	CANT_PARSE_PLUGIN
	PARSE_MESSAGE_BODY
	NOT_CONNECTED
	PARSE_MESSAGE_NAME
	PARSE_MESSAGE_GENERAL
	PARSE_INVALID_ITEM_TYPE
	PARSE_KEY_NOT_FOUND
	CANT_INIT
	CANT_CALL
	ZERO_REGISTERED_PLUGIN
	REGISTER_MANAGER
	INTERFACE_CREATE
	PROTOCOL_SERVER
	CONFIG_GET_ERROR
	CLIENT_RESPONSE_ERROR
	VALIDATE_ITEM
	RUN_BINARY
	MANAGER_NOT_FOUND
	PLUGIN_BINARY_NOT_FOUND
)

func (YapsError) String

func (y YapsError) String() string

Jump to

Keyboard shortcuts

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