Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInternalError ¶
IsInternalError determines if err is an error which indicates an internal server error.
func IsUnauthorized ¶
IsUnauthorized determines if err is an error which indicates that the request is unauthorized and requires authentication by the user.
func ReasonForError ¶
ReasonForError returns the HTTP status for a particular error.
Types ¶
type APIStatus ¶
type APIStatus interface {
Status() int
}
APIStatus is exposed by errors that can be converted to an api.Status object for finer grained details.
type StatusError ¶
func NewInternalError ¶
func NewInternalError(err error) *StatusError
NewInternalError returns an error indicating the item is invalid and cannot be processed.
func NewUnauthorized ¶
func NewUnauthorized(reason string) *StatusError
NewUnauthorized returns an error indicating the client is not authorized to perform the requested action.
func (*StatusError) Error ¶
func (e *StatusError) Error() string
func (*StatusError) Status ¶
func (e *StatusError) Status() int
Status allows access to e's http status without having to know the detailed workings of StatusError.