errors

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownError = iota
	InternalError
	ExternalError
	NetworkError
	DatabaseError
	ApplicationError
	OtherError
)

Declaration of error type enumeration.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Cause      error
	Code       int
	Desc       string
	StackTrace []string
}

Error represents an error.

func NewError

func NewError(code int, desc string) Error

NewError constructs a new error with a specific error code and description. Automatically generates a stack trace at the point it was called.

func NewErrorWithCause

func NewErrorWithCause(code int, desc string, cause error) Error

NewErrorWithCause constructs a new error with a specific error code,description and an external error reference. Automatically generates a stack trace at the point it was called.

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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