errs

package
v0.0.0-...-c953c3f Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Other              int = iota // Unclassified error. This value is not printed in the error message.
	InvalidOperation              // Invalid operation for this type of item.
	InvalidArgument               // Invalid argument
	MalformedRequest              // Malformed request body (decode problem).
	IO                            // External I/O error such as network failure.
	Logic                         // Logical error.
	Exist                         // Item already exists.
	NotExist                      // Item does not exist.
	APIAuthorization              // API authorization method related error.
	UserCredentials               // Authentication error (incorrect password, token).
	NotPermitted                  // Has no permissions.
	Private                       // Information withheld.
	Internal                      // Internal error or inconsistency.
	BrokenLink                    // Link target does not exist.
	Database                      // Error from database.
	DatabaseConnection            // Connection to database error.
	RemoteConnection              // Connection to remote service error.
	Validation                    // Input validation error.
	Unanticipated                 // Unanticipated error.
)

Variables

View Source
var (
	InvalidPassword = errors.New("invalid password")
	LogicalError    = errors.New("logical error")
)
View Source
var (
	RecordNotFound = errors.New("record is not found")
)

Functions

func HandleErrorDB

func HandleErrorDB(e error) error

func NewErrorWrapper

func NewErrorWrapper(code int, err error, message string) error

Types

type CustomErrorWrapper

type CustomErrorWrapper struct {
	Message string
	Code    int
	Err     error
}

func (CustomErrorWrapper) Dig

func (CustomErrorWrapper) Error

func (err CustomErrorWrapper) Error() string

func (CustomErrorWrapper) ErrorStack

func (err CustomErrorWrapper) ErrorStack() (res string)

func (CustomErrorWrapper) Unwrap

func (err CustomErrorWrapper) Unwrap() error

Jump to

Keyboard shortcuts

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