Documentation ¶
Overview ¶
Package bolterror provides the methods by which an error is defined and formatted for communication back to the API caller.
Index ¶
Constants ¶
const ( Internal = iota //An error within the engine logic/operation itself Request //An error related to an incoming/in-process API call Timeout //Call or command wasnt completed before the allocated timeout period Zombie //Last command wasn't completed before allocated 'zombie' give-up time. In a healthy system these shouldn't happen )
ErrType constants for NewBoltError. DO NOT CHANGE THE ORDER! Always add a new type at the bottom of the list
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltError ¶
BoltError is the wrapper for an error that needs to be communicated back to the API caller. It is recommended that it not be created directly, but via the NewBoltError function
func NewBoltError ¶
NewBoltError creates a BoltError struct using an optional source error and other details. The Parent parameter is used to differentiate this error from other errors in the event that a response contains multiple errors.
func (*BoltError) AddToPayload ¶
AddToPayload takes a gabs JSON container and adds this error's contents to the container in JSON format. The format is:
"error": { BoltError.Parent { "details": BoltError.Details, "type": BoltError.ErrType, "input": BoltError.Input, } }