Documentation ¶
Overview ¶
Package errors provide an error type with code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type E ¶
type E struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` Name string `json:"name,omitempty"` // contains filtered or unexported fields }
E define custom error that wrap underlying error with custom code, message, and name.
The Code field is required, used to communicate the HTTP response code. The Message field is optional, it's used to communicate the actual error message from server, to be readable by human. The Name field is optional, intended to be consumed by program, for example, to provide a key as translation of Message into user's locale defined language.
func InvalidInput ¶
InvalidInput generate an error for invalid input.
Click to show internal directories.
Click to hide internal directories.