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

error

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BadRequest     int = 0
	InternalServer int = 1
	NotFound       int = 2
	Invalid        int = 3
)

possible error codes for AppError implementation

Variables

This section is empty.

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Code    int
	Message string
	Err     error
}

AppError is struct of application error The Code should be a const in https://golang.org/pkg/net/http/

func AppErrorf

func AppErrorf(code int, format string, a ...interface{}) *AppError

AppErrorf create AppError from formate

func NewAppError

func NewAppError(value ...interface{}) *AppError

NewAppError create new AppError

func (AppError) Error

func (e AppError) Error() string

Error gives error string

Jump to

Keyboard shortcuts

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