Documentation
¶
Index ¶
Constants ¶
View Source
const ( // BlameUser describes the error was caused by user and the status code shall blame the user BlameUser = http.StatusBadRequest // BlameServer describes the error was caused by server internally and therefore shall blame the server BlameServer = http.StatusInternalServerError )
Variables ¶
View Source
var ( // ErrInvalidServer describes an error in which a malformed `server` provided ErrInvalidServer = New("InvalidServer", "malformed `server` provided", BlameUser) )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct { Type string `json:"type"` Details interface{} `json:"details"` Blame int `json:"-"` }
Error describes an error with several metadata to describe such error
func (*Error) Wrapped ¶
func (e *Error) Wrapped() *WrappedError
Wrapped returns a WrappedError consists of current Error
type WrappedError ¶
type WrappedError struct {
Error *Error `json:"error"`
}
WrappedError wraps Error for the client to be able to easily distinguish successful responses and error responses
Click to show internal directories.
Click to hide internal directories.