Documentation ¶
Index ¶
- Constants
- func Conflict(err error) error
- func FileTooBig(err error) error
- func Forbidden(err error) error
- func InternalError(err error) error
- func InvalidBody(err error) error
- func InvalidParameter(err error) error
- func IsConflict(err error) bool
- func IsFileTooBig(err error) bool
- func IsForbidden(err error) bool
- func IsInternalError(err error) bool
- func IsInvalidBody(err error) bool
- func IsInvalidParameter(err error) bool
- func IsNotFound(err error) bool
- func IsRequestTimeout(err error) bool
- func IsUnauthorized(err error) bool
- func New(message string) error
- func NotFound(err error) error
- func RequestTimeout(err error) error
- func Unauthorized(err error) error
- func Wrap(err error, message string) error
- type APIError
- type ErrorStack
- type Fault
- func (e *Fault) Error() string
- func (e *Fault) GetAgent(c *gin.Context) string
- func (e *Fault) GetClientIP(c *gin.Context) string
- func (e *Fault) GetCode() int
- func (e *Fault) GetDetails() string
- func (e *Fault) GetEndpoint(c *gin.Context) string
- func (e *Fault) GetErrorStack() []*ErrorStack
- func (e *Fault) GetMethod(c *gin.Context) string
- func (e *Fault) GetProgramCode(c *gin.Context) string
- func (e *Fault) GetSequence(c *gin.Context) int64
- func (e *Fault) GetTrackingID(c *gin.Context) string
- func (e *Fault) GetType() string
- func (e *Fault) GetUserID(c *gin.Context) string
- func (e *Fault) Notify() *Fault
- func (e *Fault) StackTrace() *Fault
Constants ¶
const FileTooBigCode = "FileTooBig"
FileTooBigCode text code
const ForbiddenCode = "Forbidden"
ForbiddenCode text code
const InternalErrorCode = "InternalError"
InternalErrorCode text code
const InvalidBodyCode = "InvalidBody"
InvalidBodyCode ...
const InvalidParameterCode = "InvalidParameter"
InvalidParameterCode ...
const NotFoundCode = "NotFound"
NotFoundCode ...
const RequestTimeoutCode = "RequestTimeout"
RequestTimeoutCode ...
UnauthorizedCode ...
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorStack ¶
type ErrorStack struct { LOC int `json:"loc"` File string `json:"file"` Package string `json:"package"` FuncName string `json:"func_name"` }
ErrorStack .
type Fault ¶
type Fault struct { Type string `json:"type"` Code int `json:"code"` Details string `json:"details"` // contains filtered or unexported fields }
Fault .
func (*Fault) GetAgent ¶
GetAgent return the currenct agent (browser/mobile, etc) who begins the request
func (*Fault) GetClientIP ¶
GetClientIP return the current client ip who begins the request
func (*Fault) GetCode ¶
GetCode return the http code status to identify errors focused on the http request flow
func (*Fault) GetDetails ¶
GetDetails return more information about the error
func (*Fault) GetEndpoint ¶
GetEndpoint return the current request endpoint for the current context where was produced the error
func (*Fault) GetErrorStack ¶
func (e *Fault) GetErrorStack() []*ErrorStack
GetErrorStack return the current service where was produced the error
func (*Fault) GetMethod ¶
GetMethod return the current request method for the current context where was produced the error
func (*Fault) GetProgramCode ¶
GetProgramCode return the current program_code of the current request
func (*Fault) GetSequence ¶
GetSequence return a sequence used to identify in what step happens the error
func (*Fault) GetTrackingID ¶
GetTrackingID return a unique identifier used to attach the whole request between microservices
func (*Fault) Notify ¶
Notify allows to send an email notification when some errors it's really important to fix.
func (*Fault) StackTrace ¶
StackTrace return much more information about where was generated the current error, information such as name of microservice or package, line of code, file and caller's name function. This information is getting from execution time.