To install the package, run:
go get github.com/go-zoox/errors
package main
import (
stderrors "errors"
"github.com/go-zoox/errors"
)
func main() {
err := f3()
fmt.Println(err)
}
func f1() error {
return errors.New("string1")
}
func f2() error {
return errors.Wrap(f1(), "custom message f2")
}
func f3() error {
return errors.Wrapf(f2(), "custom message f3 %s", "test")
}
- PumpkinSeed/errors - Simple and efficient error package.
- bnkamalesh/errors - A drop-in replacement for Go errors, with some added sugar! Unwrap user-friendly messages, HTTP status code, easy wrapping with multiple error types.
- pkg/errors - imple error handling primitives.
GoZoox is released under the MIT License.