errors

package
v0.0.0-...-f7e20ac Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError interface {
	Status() int
	Message() string
	Error() string
}

APIError defines an error in using the API

func NewAPIError

func NewAPIError(statusCode int, message string) APIError

NewAPIError returns an error with the provided inputs

func NewAPIErrorFromBytes

func NewAPIErrorFromBytes(body []byte) (APIError, error)

NewAPIErrorFromBytes returns an error based on a byte slice

func NewBadRequestError

func NewBadRequestError(message string) APIError

NewBadRequestError returns an error indicating a problem with the API request

func NewInternalServerError

func NewInternalServerError(message string) APIError

NewInternalServerError retuns an error indicating an internal server error

func NewNotFoundAPIError

func NewNotFoundAPIError(message string) APIError

NewNotFoundAPIError returns an APIError indicating data wasn't found

Jump to

Keyboard shortcuts

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