errors

package
v0.0.0-...-6cd7eb2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBadRequestError

func NewBadRequestError(err error) error

NewBadRequestError creates an apiError with status code 400.

func NewConflictRequestError

func NewConflictRequestError(err error) error

NewConflictRequestError creates an apiError with status code 409.

func NewErrorWithStatusCode

func NewErrorWithStatusCode(err error, status int) error

NewErrorWithStatusCode creates a new apiError with a given status code

func NewRequestInternalServerError

func NewRequestInternalServerError(err error) error

NewRequestInternalServerError creates an apiError with status code 500.

func NewRequestMethodNotAllowed

func NewRequestMethodNotAllowed(err error) error

NewRequestMethodNotAllowed creates an apiError with status code 405.

func NewRequestNotFound

func NewRequestNotFound(err error) error

NewRequestNotFound creates an apiError with status code 404.

func NewRequestNotImplemented

func NewRequestNotImplemented(err error) error

NewRequestNotImplemented creates an apiError with status code 501.

Types

type APIError

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

APIError holds information about an error including status codes.

func (APIError) Error

func (e APIError) Error() string

Error implements the error interface for apiError

func (APIError) GetHTTPErrorStatusCode

func (e APIError) GetHTTPErrorStatusCode() int

GetHTTPErrorStatusCode returns the status code.

Jump to

Keyboard shortcuts

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