errors

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 1 Imported by: 27

Documentation

Index

Constants

View Source
const (
	NoType = ErrorType(iota)
	BadRequest
	NotFound
	Conflict
	RequestTimeout
	ServiceUnavailable
	Forbidden
	Unauthorized

	Internal = NoType
)

Variables

This section is empty.

Functions

func Cause

func Cause(err error) error

Cause gives the original error

func GetStackTrace

func GetStackTrace(err error) errors.StackTrace

func Is

func Is(err error, target error) bool

Types

type ErrorType

type ErrorType uint

func GetType

func GetType(err error) ErrorType

GetType returns the error type

func (ErrorType) New

func (t ErrorType) New(msg string) FocusError

New creates a new FocusError

func (ErrorType) Newf

func (t ErrorType) Newf(msg string, args ...interface{}) FocusError

Newf creates a new FocusError with formatted message

func (ErrorType) Wrap

func (t ErrorType) Wrap(err error, msg string) FocusError

Wrap creates a new wrapped error

func (ErrorType) Wrapf

func (t ErrorType) Wrapf(err error, msg string, args ...interface{}) FocusError

Wrapf creates a new wrapped error with formatted message

type FocusError

type FocusError struct {
	Trans *Trans
	// contains filtered or unexported fields
}

func (FocusError) Error

func (e FocusError) Error() string

Error returns the message of a FocusError

func (FocusError) T

func (e FocusError) T(msg string, params ...string) FocusError

func (FocusError) Unwrap

func (e FocusError) Unwrap() error

type Trans

type Trans struct {
	Msg    string
	Params []string
}

Jump to

Keyboard shortcuts

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