errctx

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: MIT Imports: 2 Imported by: 0

README

go-errctx

GoDoc Build Status codecov Go Report Card GitHub last commit GitHub tag License

Golang library for structured error

Usage

See examples and GoDoc.

License

MIT

Documentation

Overview

Package errctx is a library for structured error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

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

Error is a structured error.

func Wrap

func Wrap(err error, fields Fields, msgs ...string) Error

Wrap returns an error added fields and msgs. err should not be nil.

func Wrapf added in v0.2.0

func Wrapf(err error, fields Fields, msg string, a ...interface{}) Error

Wrapf is a shordhand of combination of Wrap and fmt.Sprintf .

func (Error) Cause

func (e Error) Cause() error

Cause returns a base error.

func (Error) Error

func (e Error) Error() string

Error returns a message represents error.

func (Error) Fields

func (e Error) Fields() Fields

Fields returns structured data of error.

func (Error) Msgs

func (e Error) Msgs() []string

Msgs returns messages.

type Fields

type Fields map[string]interface{}

Fields is structured data of error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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