errors

package
v0.0.0-...-05f81da Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf Returns a new error with the stack information

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns true if err is a ValidationError returns false otherwise

func ValidationErrorf

func ValidationErrorf(format string, a ...interface{}) error

ValidationErrorf formats a new ValidationError

func Wrap

func Wrap(err error) error

Wrap returns an error with the caller stack information embedded in the original error message

Types

type TraceableError

type TraceableError struct {
	Trace string
	When  time.Time
	What  string
}

TraceableError is an internal error used to carry trace details to be shared across the multiple layers and reporting facilities

func (TraceableError) Error

func (e TraceableError) Error() string

type ValidationError

type ValidationError struct {
	When time.Time
	What string
}

ValidationError is a type of error used to report model or any general condition validation error. We don't deal this error as a regular error i.e panic`ing, showing the error stack trace and exiting with a non zero code, otherwise, we do show a nicely formatted and user friendly error message (the What attribute) and keep returning a non zero exit code. Consider this error as a user error, not an internal malfunctioning.

func (ValidationError) Error

func (ve ValidationError) Error() string

Jump to

Keyboard shortcuts

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