Documentation ¶ Index ¶ Variables func BadRequest(code int, detail string) error func ParseFromRPCError(err error) error type Error func Parse(err string) *Error func (e *Error) Error() string 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 Source Files ¶ View all Source files errors.go Click to show internal directories. Click to hide internal directories.