errors

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target any) bool

Implement golang errors.As, finds the first error in err's chain that matches target, and if one is found, sets target to that error value and returns true

func GetCaller

func GetCaller(err error) (string, int, string, error)

func GetCode

func GetCode(err error) codes.Code

func Is

func Is(err error, target error) bool

Implement golang errors.Is, reports whether any error in err's chain matches target.

func NewWithCode

func NewWithCode(code codes.Code, msg string, val ...interface{}) error

Types

type App

type App struct {
	Code  codes.Code `json:"code"`
	Title string     `json:"title"`
	Body  string     `json:"body"`
	// contains filtered or unexported fields
}

func Compile

func Compile(err error, lang string) (int, App)

Compile returns an error and creates new App errors

func (*App) Error

func (e *App) Error() string

Jump to

Keyboard shortcuts

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