Documentation ¶
Index ¶
- func BuildGRPCError(err error) error
- func FromGRPCError(err error) error
- func IsAlreadyExists(err error) bool
- func IsInternal(err error) bool
- func IsInvalidArgument(err error) bool
- func IsNotFound(err error) bool
- func IsPermissionDenied(err error) bool
- func New(message string) error
- func NewErrAlreadyExists(entity string) error
- func NewErrInternal(message string) error
- func NewErrInvalidArgument(argument string, reason string) error
- func NewErrNotFound(entity string) error
- func NewErrPermissionDenied(reason string) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type ErrAlreadyExists
- type ErrInternal
- type ErrInvalidArgument
- type ErrNotFound
- type ErrPermissionDenied
- type ErrType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildGRPCError ¶
BuildGRPCError returns the error with a GRPC code
func FromGRPCError ¶
FromGRPCError creates a regular error with the same type as the gRPC error
func IsAlreadyExists ¶ added in v2.6.0
IsAlreadyExists returns whether error type is AlreadyExists
func IsInternal ¶ added in v2.6.0
IsInternal returns whether error type is Internal
func IsInvalidArgument ¶ added in v2.6.0
IsInvalidArgument returns whether error type is InvalidArgument
func IsNotFound ¶ added in v2.6.0
IsNotFound returns whether error type is NotFound
func IsPermissionDenied ¶ added in v2.6.0
IsPermissionDenied returns whether error type is PermissionDenied
func New ¶
New returns an error with the supplied message. New also records the stack trace at the point it was called.
func NewErrAlreadyExists ¶
NewErrAlreadyExists returns a new ErrAlreadyExists for the given entitiy
func NewErrInternal ¶
NewErrInternal returns a new ErrInternal with the given message
func NewErrInvalidArgument ¶
NewErrInvalidArgument returns a new ErrInvalidArgument for the given entitiy
func NewErrNotFound ¶
NewErrNotFound returns a new ErrNotFound for the given entitiy
func NewErrPermissionDenied ¶
NewErrPermissionDenied returns a new ErrPermissionDenied with the given reason
Types ¶
type ErrAlreadyExists ¶
type ErrAlreadyExists struct {
// contains filtered or unexported fields
}
ErrAlreadyExists indicates that an entity already exists
func (ErrAlreadyExists) Error ¶
func (err ErrAlreadyExists) Error() string
Error implements the error interface
type ErrInternal ¶
type ErrInternal struct {
// contains filtered or unexported fields
}
ErrInternal indicates that an internal error occured
func (ErrInternal) Error ¶
func (err ErrInternal) Error() string
Error implements the error interface
type ErrInvalidArgument ¶
type ErrInvalidArgument struct {
// contains filtered or unexported fields
}
ErrInvalidArgument indicates that an argument was invalid
func (ErrInvalidArgument) Error ¶
func (err ErrInvalidArgument) Error() string
Error implements the error interface
type ErrNotFound ¶
type ErrNotFound struct {
// contains filtered or unexported fields
}
ErrNotFound indicates that an entity was not found
func (ErrNotFound) Error ¶
func (err ErrNotFound) Error() string
Error implements the error interface
type ErrPermissionDenied ¶
type ErrPermissionDenied struct {
// contains filtered or unexported fields
}
ErrPermissionDenied indicates that permissions were not sufficient
func (ErrPermissionDenied) Error ¶
func (err ErrPermissionDenied) Error() string
Error implements the error interface
type ErrType ¶
type ErrType string
const ( AlreadyExists ErrType = "already exists" Internal ErrType = "internal" InvalidArgument ErrType = "invalid argument" NotFound ErrType = "not found" OutOfRange ErrType = "out of range" PermissionDenied ErrType = "permission denied" Unknown ErrType = "unknown" )
These constants represent error types