errors

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: LGPL-3.0 Imports: 3 Imported by: 86

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(code ErrorCode, args ...interface{}) error

Create creates a seele error with specified error code and parameters.

func Get

func Get(code ErrorCode) error

Get returns a seele error with specified error code.

func IsOrContains

func IsOrContains(err error, inner error) bool

IsOrContains indicates whether the err is the specified inner error, or the err is StackedError and contains the specified inner error.

func New

func New(text string) error

New returns an error that formats as the given text.

func NewStackedError

func NewStackedError(inner error, msg string) error

NewStackedError returns a StackedError with specified inner error and error msg.

func NewStackedErrorf

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

NewStackedErrorf returns a StackedError with specified inner error and an error format specifier.

Types

type ErrorCode

type ErrorCode int

ErrorCode represents the error code type in seele.

const (

	// ErrDecrypt error when the passphrase is not right.
	ErrDecrypt ErrorCode
	// ErrEmptyAuthKey error when the auth key is empty.
	ErrEmptyAuthKey
	// ErrKeyVersionMismatch error when the auth key version does not match.
	ErrKeyVersionMismatch
	// ErrAddressLenInvalid is returned when the address length is invalid.
	ErrAddressLenInvalid
	// ErrPasswordRepeatMismatch is returned when the repeat password is not equal to the origin one.
	ErrPasswordRepeatMismatch
)

type StackedError

type StackedError struct {
	// contains filtered or unexported fields
}

StackedError records errors that occurred in call stack.

func (*StackedError) Error

func (err *StackedError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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