Documentation
¶
Overview ¶
Package errors holds some of the defined wrappers to handle specific type of errors.
Index ¶
Constants ¶
const (
ErrInternalDatabase = "database_error"
)
Constants that can be used to identify internal server errors
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadParameterError ¶
type BadParameterError struct {
// contains filtered or unexported fields
}
BadParameterError means that a parameter was not as required
func NewBadParameterError ¶
func NewBadParameterError(param string, actual interface{}) BadParameterError
NewBadParameterError returns the custom defined error of type NewBadParameterError.
func (BadParameterError) Error ¶
func (err BadParameterError) Error() string
Error implements the error interface
func (BadParameterError) Expected ¶
func (err BadParameterError) Expected(expexcted interface{}) BadParameterError
Expected sets the optional expectedValue parameter on the BadParameterError
type ConversionError ¶
type ConversionError struct {
// contains filtered or unexported fields
}
ConversionError error means something went wrong converting between different representations
func NewConversionError ¶
func NewConversionError(msg string) ConversionError
NewConversionError returns the custom defined error of type NewConversionError.
type ForbiddenError ¶
type ForbiddenError struct {
// contains filtered or unexported fields
}
ForbiddenError means that the operation is forbidden
func NewForbiddenError ¶
func NewForbiddenError(msg string) ForbiddenError
NewForbiddenError returns the custom defined error of type ForbiddenError.
type InternalError ¶
type InternalError struct {
// contains filtered or unexported fields
}
InternalError means that the operation failed for some internal, unexpected reason
func NewInternalError ¶
func NewInternalError(msg string) InternalError
NewInternalError returns the custom defined error of type InternalError.
type NotFoundError ¶
type NotFoundError struct { ID string // contains filtered or unexported fields }
NotFoundError means the object specified for the operation does not exist
func NewNotFoundError ¶
func NewNotFoundError(entity string, id string) NotFoundError
NewNotFoundError returns the custom defined error of type NewNotFoundError.
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type UnauthorizedError ¶
type UnauthorizedError struct {
// contains filtered or unexported fields
}
UnauthorizedError means that the operation is unauthorized
func NewUnauthorizedError ¶
func NewUnauthorizedError(msg string) UnauthorizedError
NewUnauthorizedError returns the custom defined error of type UnauthorizedError.
type VersionConflictError ¶
type VersionConflictError struct {
// contains filtered or unexported fields
}
VersionConflictError means that the version was not as expected in an update operation
func NewVersionConflictError ¶
func NewVersionConflictError(msg string) VersionConflictError
NewVersionConflictError returns the custom defined error of type VersionConflictError.