resperr

package
v0.0.0-...-cb04537 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WrittenJson     = NewResErrForStr(writtenJson, http.StatusInternalServerError)
	InvalidUrl      = NewResErrForStr(invalidUrl, http.StatusBadRequest)
	InvalidResource = NewResErrForStr(invalidResource, http.StatusUnprocessableEntity)
	NotBodyProvided = NewResErrForStr(notBodyProvided, http.StatusBadRequest)
	BadRequest      = NewResErrForStr(badRequest, http.StatusBadRequest)
	NotFound        = NewResErrForStr(resourceNotFound, http.StatusNotFound)
	None            = ResponseError{/* contains filtered or unexported fields */}
)

Functions

This section is empty.

Types

type ResponseError

type ResponseError struct {
	ErrorStr string `json:"error"`

	Message []string `json:"message,omitempty"`
	// contains filtered or unexported fields
}

func FromError

func FromError(err error) ResponseError

func FromErrorMessage

func FromErrorMessage(err ResponseError, msg []string) ResponseError

func NewResErrForStr

func NewResErrForStr(str string, status int) ResponseError

func (ResponseError) Error

func (e ResponseError) Error() string

func (ResponseError) Status

func (e ResponseError) Status() int

func (ResponseError) Write

func (e ResponseError) Write(w http.ResponseWriter)

Jump to

Keyboard shortcuts

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