rest_errors

package
v0.0.0-...-b21e3e0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestErr

type RestErr interface {
	Status() int     // HTTP status code
	Title() string   // A string representation of the Status Code
	Path() string    // Only used for Logging: The path of the error. Ex: "controller/controllerfunc/service/servicefunc/dbclient/dblientfunc"
	WrapPath(string) // Only used for Logging: Wrapper func to keep track of the path of the error
	Code() string    // Only used for Logging: Raw error code
	Message() string // Only used for Logging: Raw error message not returned to the client

	Error() string // string representation of a restErr
}

func CheckRestError

func CheckRestError(path string, err error, resp *resty.Response) RestErr

func NewBadRequestError

func NewBadRequestError(path string, message string, cause string) RestErr

func NewConflictError

func NewConflictError(path string, message string) RestErr

func NewGoneError

func NewGoneError(path string, message string) RestErr

func NewInternalServerError

func NewInternalServerError(path string, code string, msg string) RestErr

constructors

func NewNotFoundError

func NewNotFoundError(path string, message string) RestErr

func NewRestError

func NewRestError(message string, status int, cause string) RestErr

func NewRestErrorFromBytes

func NewRestErrorFromBytes(bytes []byte) (RestErr, error)

func NewServiceUnavailableError

func NewServiceUnavailableError(path string, message string) RestErr

func NewUnauthorizedError

func NewUnauthorizedError(path string, message string) RestErr

func NewUnprocessableEntityError

func NewUnprocessableEntityError(path string, message string) RestErr

Jump to

Keyboard shortcuts

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