errors

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(e error) string

Returns the Web3Error code

If e is not type of Web3Error returns an empty string

func Message

func Message(e error) string

Returns the Web3Error message

If e is not type of Web3Error returns an empty string

func New

func New(code string, text string) error

New returns an error that formats as the given code and text (the message). Each call to New returns a distinct error value even if the text is identical.

Types

type Web3Error

type Web3Error struct {
	Code    string
	Message string
}

errorString is a trivial implementation of error.

func GetWeb3Error

func GetWeb3Error(err error) *Web3Error

func (Web3Error) Error

func (e Web3Error) Error() string

func (Web3Error) MarshalJSON

func (e Web3Error) MarshalJSON() ([]byte, error)

Implements the json.Marshaler interface to control JSON serialization.

func (*Web3Error) Scan

func (e *Web3Error) Scan(value interface{}) error

Implements the sql.Scanner interface to be able to read it from MySQL

func (*Web3Error) String

func (e *Web3Error) String() string

func (Web3Error) Value

func (e Web3Error) Value() (driver.Value, error)

Implements the driver.Valuer interface to be able to insert it into MySQL

Jump to

Keyboard shortcuts

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