Skip to content

Error manager with error and caused by structure.

License

Notifications You must be signed in to change notification settings

joaosoft/errors

Repository files navigation

errors

Build Status | codecov | Go Report Card | GoDoc

Error handling with caused-by and stack.

If i miss something or you have something interesting, please be part of this project. Let me know! My contact is at the end.

Dependecy Management

Dependency

Project dependencies are managed using Dep. Read more about Dep.

  • Get dependency manager: go get github.com/joaosoft/dependency
  • Install dependencies: dependency get

Go

go get github.com/joaosoft/errors

Usage

This examples are available in the project at examples/main.go

var (
	ErrorOne = errors.New(errors.LevelError, 1, "Error one")
	ErrorTwo = errors.New(errors.LevelError, 2, "Error two")
)

func main() {
	fmt.Println("\nADDING ERRORS!\n")

	errs := errors.Add(ErrorOne).
		Add(ErrorTwo)

	fmt.Println(errs.Cause())

	fmt.Println(errs.Stack)
	fmt.Println(errs.Previous.Stack)

	fmt.Println("\nDONE!")
}

Known issues

Follow me at

Facebook: https://www.facebook.com/joaosoft

LinkedIn: https://www.linkedin.com/in/jo%C3%A3o-ribeiro-b2775438/

If you have something to add, please let me know joaosoft@gmail.com

About

Error manager with error and caused by structure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published