apierrors

package
v0.0.0-...-df84525 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: GPL-3.0 Imports: 5 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 struct {
	Err         error  `json:"-"`
	Description string `json:"description"`
	Cause       string `json:"cause"`
	Status      int    `json:"status"`
}

APIError is the JSON body to show on a failed response.

func NewBadRequestError

func NewBadRequestError(err error) *APIError

NewBadRequestError creates a new APIError for invalid input.

func NewInternalServerError

func NewInternalServerError(err error) *APIError

NewInternalServerError creates a new APIError for internal errors.

func NewNotFoundError

func NewNotFoundError() *APIError

NewNotFoundError creates a new APIError for resource not found.

Jump to

Keyboard shortcuts

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