exception

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIException

type APIException struct {
	Code    Code   `json:"code"`
	Message string `json:"message"`
}

func New

func New(code Code, format string, args ...interface{}) APIException

func Wrap

func Wrap(code Code, err error) APIException

func (APIException) Error

func (ae APIException) Error() string

type Code

type Code uint16
const (
	CodeServerError Code = 1000 + iota
	CodeNotFound
	CodeInvalidParams
	CodeAuth
	CodeUnknownError
)

func (Code) HttpStatus

func (ec Code) HttpStatus() int

Jump to

Keyboard shortcuts

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