Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is a convenient NotFound error with a default message ErrNotFound = NotFound("not found") ErrUnauthorized = Unauthorized("unauthorized") )
Functions ¶
This section is empty.
Types ¶
type BackendError ¶
BackendError is an error type which can easily be sent as a response to an API user
func Invalid ¶
func Invalid(detail string) BackendError
Invalid creates a BackendError which indicates a problem with the user's request
func New ¶
func New(detail string, code int) BackendError
New creates a new Err with the given detail message and error code
func NotFound ¶
func NotFound(detail string) BackendError
NotFound creates a BackendError that indicates a requested resource was unavailable
func Unauthorized ¶
func Unauthorized(detail string) BackendError
Unauthorized creates a BackendError which indicates a the user didn't have the correct permissions
func Unexpected ¶
func Unexpected(detail string) BackendError
Unexpected creates a BackendError that should be returned if something happened which we didn't expect and cannot recover from
Click to show internal directories.
Click to hide internal directories.