Documentation ¶
Index ¶
- Constants
- func BadRequestError(msg string) error
- func Errorf(ref int, format string, i ...interface{}) error
- func Forbiddenf(format string, i ...interface{}) error
- func InternalErrorf(format string, i ...interface{}) error
- func InvalidDataf(format string, i ...interface{}) error
- func MalformedDataf(format string, i ...interface{}) error
- func New(msg string, ref ...int) error
- func Wrap(err error, msg string, ref ...int) error
- type Error
- type List
Constants ¶
View Source
const ( // InternalError indicates an unexpected error condition. InternalError = 1 // MalformedData indicates malformed input, such as unparsable JSON. MalformedData = 2 // InvalidData indicates that data is well-formed, but invalid. InvalidData = 3 // Forbidden indicates a forbidden operation. Forbidden = 4 // NotFound indicates a resource was not found. NotFound = 5 )
Variables ¶
This section is empty.
Functions ¶
func BadRequestError ¶
func Forbiddenf ¶
Forbiddenf constructs a Forbidden error with the given format.
func InternalErrorf ¶
InternalErrorf constructs an InternalError with the given format.
func InvalidDataf ¶
InvalidDataf constructs an InvalidData error with the given format.
func MalformedDataf ¶
MalformedDataf constructs a MalformedData error with the given format.
Types ¶
type Error ¶
type Error struct { Reference int `json:"referenceCode"` Code int `json:"statusCode"` Err string `json:"err"` }
Error indicates an error with a reference code and an HTTP status code.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List represents a list of errors.
func (*List) AppendString ¶
AppendString adds a new error that formats as the given text.
Click to show internal directories.
Click to hide internal directories.