Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

reconquest/hierr-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hierarchical errors made right Go Report Card

Hate seeing error: exit status 128 in the output of programs without actual explanation what is going wrong?

Or, maybe, you're more advanced in programming, and use errors concatenation?

can't pull remote 'origin': can't run git fetch 'origin' 'refs/tokens/*:refs/tokens/*': exit status 128

Better, but still unreadable.

hierr

Transform error reports into hierarchy:

can't pull remote 'origin'
└─ can't run git fetch 'origin' 'refs/tokens/*:refs/tokens/*'
   └─ exit status 128

To use hierarchy error reporting, just convert fmt.Errorf calls:

return fmt.Errorf("can't pull remote '%s': %s", remote, err)

return hierr.Errorf(err, "can't pull remote '%s'", remote)

Docs: https://godoc.org/github.com/seletskiy/hierr

About

Hierarchical errors reporting done right in Golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages