errors

package
v1.17.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

DEPRECATED: This package is deprecated and will be removed in a future release.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any

func Any(err error, targets ...error) bool

Any reports whether an error in error's chain matches to any error provided in list.

func ExitErr

func ExitErr(text string, err error, code int)

ExitErr prints error to os.Stderr and call os.Exit with given code.

func ExitMsg

func ExitMsg(text string, code int)

ExitMsg prints message to os.Stderr and call os.Exit with given code.

func Is

func Is(err, target error) bool

Is wraps function errors.Is from stdlib to avoid import it in other places of the magma smart contract (magmasc) package.

func New

func New(code, text string) *errWrapper

New returns constructed error wrapper interface.

func Wrap

func Wrap(code, text string, err error) *errWrapper

Wrap wraps given error into a new error with format.

Types

type Error

type Error struct {
	Code string `json:"code,omitempty"`
	Msg  string `json:"msg"`
}

Error type for a new application error.

Jump to

Keyboard shortcuts

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