custom_errors

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReturnBadRequestError

func ReturnBadRequestError(w http.ResponseWriter, messages []string)

func ReturnConflictError

func ReturnConflictError(w http.ResponseWriter, messages []string)

func ReturnForbiddenError

func ReturnForbiddenError(w http.ResponseWriter, messages []string)

func ReturnHTTPError

func ReturnHTTPError(w http.ResponseWriter, messages []string)

func ReturnMethodNotAllowedError added in v1.1.2

func ReturnMethodNotAllowedError(w http.ResponseWriter, messages []string)

func ReturnNotFoundError

func ReturnNotFoundError(w http.ResponseWriter, messages []string)

func ReturnUnauthorizedError

func ReturnUnauthorizedError(w http.ResponseWriter, messages []string)

func ReturnUnprocessableEntityError

func ReturnUnprocessableEntityError(w http.ResponseWriter, messages []string)

Types

type ErrorResponse

type ErrorResponse struct {
	Status  int      `json:"status"`
	Message string   `json:"message"`
	Errors  []string `json:"errors"`
}

func NewErrorResponse

func NewErrorResponse(status int, message string, errors []string) ErrorResponse

Jump to

Keyboard shortcuts

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