e

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserNotFound = iota
	BusinessNotFound
	InternalServerError
	EmailExisted
	PasswordIncorrect
	AccountLocked
	TokenInvalid
	InvalidPageNumber
	ExceedMaxPosBalance
	ExceedMaxNegBalance
)

Variables

View Source
var Msg = map[int]string{
	UserNotFound:        "Email address not found.",
	BusinessNotFound:    "Business not found.",
	EmailExisted:        "Email address is already registered.",
	TokenInvalid:        "Invalid token.",
	PasswordIncorrect:   "Invalid password.",
	AccountLocked:       "Your account has been temporarily locked for 15 minutes. Please try again later.",
	InternalServerError: "Sorry, something went wrong. Please try again later.",
	InvalidPageNumber:   "Invalid page number: should start with 1.",
	ExceedMaxPosBalance: "Transfer rejected: receiver will exceed maximum balance limit.",
	ExceedMaxNegBalance: "Transfer rejected: you will exceed your maximum negative balance limit.",
}

Functions

func CustomMessage

func CustomMessage(message string) error

func IsPasswordInvalid

func IsPasswordInvalid(err error) bool

func IsUserNotFound

func IsUserNotFound(err error) bool

func New

func New(code int, systemErr interface{}) error

func Wrap

func Wrap(err error, message string) error

Types

type Error

type Error struct {
	Code          int
	CustomMessage string
	SystemErr     error
}

func (Error) Error

func (d Error) Error() string

func (Error) Message

func (d Error) Message() string

Jump to

Keyboard shortcuts

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