rest_errors

package
v0.0.0-...-6afef70 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: MIT Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(msg string) error

Types

type RestError

type RestError struct {
	Message string        `json:"message"`
	Status  int           `json:"status"`
	Error   string        `json:"error"`
	Causes  []interface{} `json:"causes"`
}

RestError - Struct for handling errors and having like a template

func NewBadRequestError

func NewBadRequestError(message string) *RestError

NewBadRequestError - Function to create bad request errors like factory

func NewInternalServerError

func NewInternalServerError(message string, err error) *RestError

NewInternalServerError - Function to create 500 errors

func NewNotFoundError

func NewNotFoundError(message string) *RestError

NewNotFoundError - Function to create not found errors

Jump to

Keyboard shortcuts

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