xerror

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeMsg

type CodeMsg struct {
	Code int
	Msg  string
}

CodeMsg is a struct that contains a code and a message. It implements the error interface.

func NewCodeMsg

func NewCodeMsg(code int, msg string) *CodeMsg

NewCodeMsg creates a new CodeMsg.

func (*CodeMsg) Error

func (c *CodeMsg) Error() string

type HTTPError

type HTTPError struct {
	Code    int    `json:"-"`
	Message string `json:"message"`
}

func NewHTTPError

func NewHTTPError(code int, message ...string) *HTTPError

NewHTTPError creates a new HTTPError instance.

func (HTTPError) Error

func (he HTTPError) Error() string

Jump to

Keyboard shortcuts

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