errors

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: BSD-3-Clause Imports: 1 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type string

Type represents a type of Error returned from the middleware

var (
	BadRequestError       Type = "bad_request"
	UnauthorizedError     Type = "unauthorized"
	ForbiddenError        Type = "forbidden"
	NotFoundError         Type = "not_found"
	ConflictError         Type = "conflict"
	InternalServerError   Type = "internal"
	NotImplementedError   Type = "not_implemented"
	MethodNotAllowedError Type = "method_not_allowed"
)

Error Types mapped to their text presentations

func TypeForStatusCode

func TypeForStatusCode(code int) (Type, bool)

TypeForStatusCode returns the Type that is matched for a given status code. If no Type is found, it will return false.

func (Type) Code

func (t Type) Code() int

Code returns the http status code for this type

func (Type) String

func (t Type) String() string

String returns the string representation of this error type

Jump to

Keyboard shortcuts

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