restErrors

package module
v0.0.0-...-671ebc7 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 4 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(msg string) error

NewError returns a new error with an input message

Types

type RestErr

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

func NewBadRequestError

func NewBadRequestError(message string) RestErr
NewBadRequestError returns a standardized struct with the correct status,

* and error tag for bad request situations * Args: * message (string): The message to be assigned to the struct's Message field

func NewInternalServerError

func NewInternalServerError(message string) RestErr
NewInternalServerError returns a standardized struct with the correct status,

* and error tag for internal error situations * Args: * message (string): The message to be assigned to the struct's Message field

func NewNotFoundError

func NewNotFoundError(message string) RestErr
NewNotFoundError returns a standardized struct with the correct status,

* and error tag for not found situations * Args: * message (string): The message to be assigned to the struct's Message field

func NewRestError

func NewRestError(message string, status int, err string, causes []interface{}) RestErr

func NewRestErrorFromBytes

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

func NewUnauthorized

func NewUnauthorized(message string) RestErr
NewUnauthorized returns a standardized struct with the correct status,

* and error tag for unauthorized access situations * Args: * message (string): The message to be assigned to the struct's Message field

Jump to

Keyboard shortcuts

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