Documentation ¶
Overview ¶
Package httperror defines the format for HTTP error responses from Chain services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter struct { Default Info IsTemporary func(info Info, err error) bool Errors map[error]Info }
Formatter defines rules for mapping errors to the Chain error response format.
func (Formatter) Format ¶
Format builds an error Response body describing err by consulting the f.Errors lookup table. If no entry is found, it returns f.Default.
type Info ¶
type Info struct { HTTPStatus int `json:"-"` ChainCode string `json:"code"` Message string `json:"message"` }
Info contains a set of error codes to send to the user.
Click to show internal directories.
Click to hide internal directories.