Help us shape the future of Go! Take the 2026 Go Developer Survey

errors

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess            = 0
	CodeBadRequest         = 1001
	CodeUnauthorized       = 1002
	CodeForbidden          = 1003
	CodeNotFound           = 1004
	CodeConflict           = 1005
	CodeInternalError      = 1006
	CodeServiceUnavailable = 1007
	CodeTooManyRequests    = 1008
)

Variables

This section is empty.

Functions

func GetErrorCode

func GetErrorCode(err error) int

func GetMessage

func GetMessage(code int) string

func IsAppError

func IsAppError(err error) bool

Types

type AppError

type AppError struct {
	Code    int
	Message string
	Cause   error
}

func BadRequest

func BadRequest(message string) *AppError

func Conflict

func Conflict(message string) *AppError

func Forbidden

func Forbidden(message string) *AppError

func InternalError

func InternalError(message string) *AppError

func New

func New(code int, message string) *AppError

func NotFound

func NotFound(message string) *AppError

func Unauthorized

func Unauthorized(message string) *AppError

func Wrap

func Wrap(code int, message string, cause error) *AppError

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) Unwrap

func (e *AppError) Unwrap() error

Jump to

Keyboard shortcuts

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