errorx

package
v0.0.96 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 76

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(w http.ResponseWriter, err []Message)

Render - render errors

Types

type Message

type Message struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Source  string `json:"source"`
}

Message - error model

func CannotDelete

func CannotDelete(entity, association string) Message

CannotDelete - errors for cannot delete associations

func CannotSaveChanges

func CannotSaveChanges() Message

CannotSaveChanges - errors when an item cannot be changed

func DBError

func DBError() Message

DBError - Database errors

func DecodeError

func DecodeError() Message

DecodeError - errors while decoding request body

func GetMessage

func GetMessage(msg string, code int) Message

GetMessage - get errorx.Message object

func InternalServerError

func InternalServerError() Message

InternalServerError error

func InvalidID

func InvalidID() Message

InvalidID error

func NetworkError

func NetworkError() Message

NetworkError - errors while connection refused

func Parser

func Parser(msg Message) []Message

Parser - to parse error Messages

func RecordNotFound

func RecordNotFound() Message

RecordNotFound - record not found error

func SameNameExist

func SameNameExist() Message

SameNameExist - errors for same name exists

func Unauthorized

func Unauthorized() Message

Unauthorized - errors for unauthorized response

Jump to

Keyboard shortcuts

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