errorx

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCodeError

func NewCodeError(code int, msg string) error

func NewCodeErrorWithLang

func NewCodeErrorWithLang(code int, msg string, langCode string) error

func NewDefaultError

func NewDefaultError(msg string) error

func NewErrorFromCode

func NewErrorFromCode(c *CodeError) error

func NewErrorf

func NewErrorf(c *CodeError, v ...interface{}) error

Types

type CodeError

type CodeError struct {
	Code        int           `json:"code"`
	Msg         string        `json:"msg"`
	LangCode    string        `json:"langCode"`
	Placeholder []interface{} `json:"placeholder"`
}

func NewRawCodeError

func NewRawCodeError(code int, msg string) *CodeError

func NewRawCodeErrorWithLangCode

func NewRawCodeErrorWithLangCode(code int, msg, langCode string) *CodeError

func (*CodeError) Data

func (e *CodeError) Data() *CodeErrorResponse

func (*CodeError) Error

func (e *CodeError) Error() string

type CodeErrorResponse

type CodeErrorResponse struct {
	Code     int    `json:"code"`
	Msg      string `json:"msg"`
	LangCode string `json:"langCode"`
}

Jump to

Keyboard shortcuts

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