appCommon

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RecordNotFound = errors.New("record not found")
)

Functions

func AppRecover

func AppRecover()

Types

type AppError

type AppError struct {
	StatusCode int    `json:"status_code"`
	RootErr    error  `json:"-"`
	Message    string `json:"message"`
	Log        string `json:"log"`
	Key        string `json:"error_key"`
}

func ErrCannotCreateEntity

func ErrCannotCreateEntity(entity string, err error) *AppError

func ErrCannotDeleteEntity

func ErrCannotDeleteEntity(entity string, err error) *AppError

func ErrCannotDeleteSessionID

func ErrCannotDeleteSessionID(err error) *AppError

func ErrCannotGetEntity

func ErrCannotGetEntity(entity string, err error) *AppError

func ErrCannotListEntity

func ErrCannotListEntity(entity string, err error) *AppError

func ErrCannotUpdateEntity

func ErrCannotUpdateEntity(entity string, err error) *AppError

func ErrDB

func ErrDB(err error) *AppError

func ErrEntityDeleted

func ErrEntityDeleted(entity string, err error) *AppError

func ErrEntityExisted

func ErrEntityExisted(entity string, err error) *AppError

func ErrEntityNotFound

func ErrEntityNotFound(entity string, err error) *AppError

func ErrInternal

func ErrInternal(err error) *AppError

func ErrInvalidRequest

func ErrInvalidRequest(err error) *AppError

func ErrNoPermission

func ErrNoPermission(err error) *AppError

func NewCustomError

func NewCustomError(root error, msg string, key string) *AppError

func NewErrorResponse

func NewErrorResponse(root error, msg, log, key string) *AppError

func NewFullErrorResponse

func NewFullErrorResponse(statusCode int, root error, msg, log, key string) *AppError

func NewUnauthorized

func NewUnauthorized(root error, msg, key string) *AppError

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) RootError

func (e *AppError) RootError() error

Jump to

Keyboard shortcuts

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