error

package
v0.2.2-0...-aec2f31 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 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