exception

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cause

func Cause(err error) error

func Stack

func Stack(err error) string

Types

type Exception

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

func (*Exception) Cause

func (err *Exception) Cause() error

Cause returns the root cause error.

func (*Exception) Error

func (err *Exception) Error() string

Error implements the interface of Error, it returns the error as string.

func (*Exception) Format

func (err *Exception) Format(s fmt.State, verb rune)

Format formats the frame according to the fmt.Formatter interface.

%v, %s : Print the error string; %-v, %-s : Print current error string; %+s : Print full stack error list; %+v : Print the error string and full stack error list;

func (*Exception) Stack

func (err *Exception) Stack() string

Stack returns the stack callers as string. It returns an empty string id the <err> does not support stacks.

type ICause

type ICause interface {
	Cause() error
}

type IException

type IException interface {
	Error() string
	Cause() error
	Format(s fmt.State, verb rune)
	Stack() string
}

func New

func New(value ...interface{}) IException

func NewText

func NewText(text string) IException

func Newf

func Newf(format string, args ...interface{}) IException

func Wrap

func Wrap(err error, text string) IException

func Wrapf

func Wrapf(err error, format string, args ...interface{}) IException

type IStack

type IStack interface {
	Stack() string
}

Jump to

Keyboard shortcuts

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