errors

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseError

func ParseError(res *http.Response) error

Types

type Error

type Error interface {
	error
	Status() int
}

Error represents a handler error. It provides methods for a HTTP status code and embeds the built-in error interface.

func Custom

func Custom(code int, param string) Error

func InternalServerError

func InternalServerError() Error

func InvalidIncomingJSON

func InvalidIncomingJSON() Error

func ParamInvalid

func ParamInvalid(param string) Error

func ParamNotUnique

func ParamNotUnique(param string) Error

type StatusError

type StatusError struct {
	Code int
	Err  error
}

StatusError represents an error with an associated HTTP status code.

func (StatusError) Error

func (se StatusError) Error() string

Allows StatusError to satisfy the error interface.

func (StatusError) Status

func (se StatusError) Status() int

Returns our HTTP status code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL