errors

package
v0.0.0-...-02cf4f6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Errors = map[int]*Error{}

Functions

func BadRequest

func BadRequest(code int, detail string) error

常用错误

func ParseFromRPCError

func ParseFromRPCError(err error) error

Types

type Error

type Error struct {
	Code     int         `json:"code"`
	Status   int         `json:"status"`
	Detail   string      `json:"detail"`
	Internal string      `json:"internal,omitempty"`
	Content  interface{} `json:"content,omitempty"`
}

func Parse

func Parse(err string) *Error

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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