errors

package
v0.0.0-...-733830a Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 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 - error interface

func NewAPIError

func NewAPIError(statusCode int, message string) APIError

NewAPIError for untrapped errors

func NewAPIErrorFromBytes

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

NewAPIErrorFromBytes - raised when testing json of bytes array

func NewBadRequestAPIError

func NewBadRequestAPIError(message string) APIError

NewBadRequestAPIError - raised for a bad request

func NewInternalServerError

func NewInternalServerError(message string) APIError

NewInternalServerError - raised on an internal server error

func NewNotFoundAPIError

func NewNotFoundAPIError(message string) APIError

NewNotFoundAPIError - raised on a not found case

Jump to

Keyboard shortcuts

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