apperror

package
v0.0.0-...-222756a Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = NewAppError("not found", "NS-000003", "")
)

Functions

func Middleware

func Middleware(h appHandler) http.HandlerFunc

Types

type AppError

type AppError struct {
	Err              error  `json:"-"`
	Message          string `json:"message,omitempty"`
	DeveloperMessage string `json:"developer_message,omitempty"`
	Code             string `json:"code,omitempty"`
}

func BadRequestError

func BadRequestError(message string) *AppError

func NewAppError

func NewAppError(message, code, developerMessage string) *AppError

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) Marshal

func (e *AppError) Marshal() []byte

func (*AppError) Unwrap

func (e *AppError) Unwrap() error

Jump to

Keyboard shortcuts

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