aerror

package module
v0.0.0-...-3421b69 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2016 License: MIT Imports: 2 Imported by: 3

README

aerror

Traceable Error for Golang GoDoc

#usage

#on error if err != nil { return aerror.WrapError(err) }

#on log/output fmt.Println(err) // use as a normal error , it will always compatable

  switch a:= err.(type){
    case *aerror.AError:
      fmt.Println(a.Trace)
      break
    default:
      fmt.Println(err)
      break
  }

#use a premade tool

  import "github.com/EnumApps/aerror/debugutil"

  if err != nil {
    debugutil.PrintTrace(err)
  }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AError

type AError struct {
	Trace []Stack
	// contains filtered or unexported fields
}

func New

func New(msg string) *AError

func WrapError

func WrapError(oe error) *AError

type Stack

type Stack struct {
	File string
	Line int
}

func TraceNow

func TraceNow(skip int) []Stack

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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