errno

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Common errors
	OK                  = &Errno{Code: 0, Message: "OK"}
	InternalServerError = &Errno{Code: 10001, Message: "Internal Server Error"}
	RouteNotFound       = &Errno{Code: 10002, Message: "Route Not Found"}
	MethodNotFound      = &Errno{Code: 10002, Message: "Method Not Found"}
)

Functions

func DecodeErr

func DecodeErr(err error) (int, string)

Types

type Err

type Err struct {
	Code    int
	Message string
	Err     error
}

Err represents an error

func New

func New(errno *Errno, err error) *Err

func (*Err) Add

func (err *Err) Add(message string) *Err

func (*Err) Addf

func (err *Err) Addf(format string, args ...interface{}) *Err

func (*Err) Error

func (err *Err) Error() string

type Errno

type Errno struct {
	Code    int
	Message string
}

func (Errno) Error

func (err Errno) Error() string

Jump to

Keyboard shortcuts

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