myerrors

package
v0.0.0-...-7bb7a1f Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDocumentNotFound = errors.New("document not found")
View Source
var ErrInternalServerError = errors.New("internel server error")

Functions

func DbErrors

func DbErrors(err error) error

func DocumentNotFoundError

func DocumentNotFoundError(err error) bool

Types

type ApiError

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

func ClientError

func ClientError(message string) *ApiError

func InternalServerError

func InternalServerError(message string) *ApiError

func NewApiError

func NewApiError(status int, message string) *ApiError

func NotFoundError

func NotFoundError(message string) *ApiError

func RecordExistsError

func RecordExistsError(record string) *ApiError

func UnauthorizedError

func UnauthorizedError() *ApiError

func (*ApiError) Error

func (e *ApiError) Error() string

type MongoError

type MongoError struct {
	Message string
	Code    int
}

func (*MongoError) Error

func (m *MongoError) Error() string

type MyError

type MyError struct {
	Code    int
	Message string
}

func (*MyError) Error

func (err *MyError) Error() string

Jump to

Keyboard shortcuts

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