errors

package
v0.0.0-...-9d97ec1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorDBWrapper

func ErrorDBWrapper(err error) error

func ErrorDBWrapperC

func ErrorDBWrapperC(err error, notFound, exists string) error

func ErrorRepoWrapper

func ErrorRepoWrapper(err error) error

func FromError

func FromError(err error, ctx context.Context) (int, string)

func NewError

func NewError(code ErrorCode, msg string) error

Types

type Error

type Error struct {
	Code    ErrorCode
	Message string
}

func (Error) Error

func (e Error) Error() string

type ErrorCode

type ErrorCode int
const (
	ERR_INTERNAL ErrorCode = iota
	ERR_NOT_FOUND
	ERR_NOT_ALLOWED
	ERR_BAD_REQUEST
)

func IntToErrorCode

func IntToErrorCode(code int) ErrorCode

type HTTPError

type HTTPError struct {
	ErrorCode int    `json:"error_code"`
	ErrorMsg  string `json:"error_msg"`
}

Jump to

Keyboard shortcuts

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