Documentation ¶
Index ¶
- Constants
- func NewErrorf(code ErrorCode, format string, a ...interface{}) error
- func WrapErrorf(orig error, code ErrorCode, format string, a ...interface{}) error
- type AuthenticationError
- type Error
- type ErrorCode
- type ForbiddenError
- type NoBodyError
- type RouterMissingParamError
- type RouterParsingError
- type UnauthorizedError
- type ValidationError
Constants ¶
const ResponseDataError = "Unexpected error during response data encoding"
ResponseDataError is used as the error message when the responses functions return an error
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthenticationError ¶
type AuthenticationError struct {
ErrString string
}
AuthenticationError happens during auth problems, for example malformed token
func (*AuthenticationError) Error ¶
func (e *AuthenticationError) Error() string
Error method transforms error structure to a string representation
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error data structure contains the original error object + assigned error code
type ErrorCode ¶
type ErrorCode uint
ErrorCode is enumeration type to specify numeric error code
const ( // ErrorCodeUnknown represents numeric error code for unknown error ErrorCodeUnknown ErrorCode = iota // ErrorCodeNotFound represents numeric error code for error that // occurs when the rule data are not found ErrorCodeNotFound // ErrorCodeInvalidArgument represents numeric error code for error // that occurs when invalid argument is provided in request ErrorCodeInvalidArgument )
type ForbiddenError ¶
type ForbiddenError struct {
ErrString string
}
ForbiddenError means user does not have permission to do a particular action, for example the account belongs to a different organization
func (*ForbiddenError) Error ¶
func (e *ForbiddenError) Error() string
Error method transforms error structure to a string representation
type NoBodyError ¶
type NoBodyError struct{}
NoBodyError error meaning that client didn't provide body when it's required
func (*NoBodyError) Error ¶
func (*NoBodyError) Error() string
type RouterMissingParamError ¶
type RouterMissingParamError struct {
ParamName string
}
RouterMissingParamError missing parameter in request
func (*RouterMissingParamError) Error ¶
func (e *RouterMissingParamError) Error() string
Error method transforms error structure to a string representation
type RouterParsingError ¶
RouterParsingError parsing error, for example string when we expected integer
func (*RouterParsingError) Error ¶
func (e *RouterParsingError) Error() string
Error method transforms error structure to a string representation
type UnauthorizedError ¶
type UnauthorizedError struct {
}UnauthorizedError means server can't authorize you, for example the token is missing or malformed
func (*UnauthorizedError) Error ¶
func (e *UnauthorizedError) Error() string
Error method transforms error structure to a string representation
type ValidationError ¶
ValidationError validation error, for example when string is longer then expected
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error method transforms error structure to a string representation