httputils

package
v0.0.0-...-e995b2c Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPError

type HTTPError struct {
	// contains filtered or unexported fields
}

HTTPError represents an HTTP error which contains potential status code. For API layer, daemon side should return error message and using correct status code to construct response when an error happens in handling requests.

func NewHTTPError

func NewHTTPError(err error, code int) HTTPError

NewHTTPError returns a brand new HTTPError with input message and status code

func (HTTPError) Code

func (err HTTPError) Code() int

Code returns status code field of HTTPError

func (HTTPError) Error

func (err HTTPError) Error() string

Error returns Message field of HTTPError

Jump to

Keyboard shortcuts

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