errors icon indicating copy to clipboard operation
errors copied to clipboard

Simple error handling primitives

Results 42 errors issues
Sort by recently updated
recently updated
newest added

https://play.golang.org/p/9pIaAGoKF1i Fixing this might break formatting elsewhere, so needs to be done carefully.

https://github.com/pkg/errors/blob/614d223910a179a466c1767a985424175c39b465/errors.go#L244 how can i change format return error message, to this func (w *withMessage) Error() string { return w.cause.Error()+ " | " + w.msg }

Every time an error is wrapped, callers() is called. This seems wasteful to me. I think the root error's stack trace is the most important and almost always what I...

At the moment, there is no way to provide a custom stack trace for an error -- the stack trace is captured at `Wrapf` (or other such wrapping) time. While...

Hi, I have a question for the project. Now there is a line of code : ``` func A() error{ return errors.Wrap(code, msg) } ``` Then I have a caller...

(Continued from PR #165). ### Description Go 1.11 will introduce support for [versioned modules](https://github.com/golang/go/wiki/Modules). When running in module-aware mode, if your package depends on `github.com/pkg/errors` then Go will download it...

Is it possible to get the message passed to `errors.Wrap(err, message)`? What I specifically mean is `message` itself, without anything from `err`. My use case is that I wrap underlying...

As of now, when wrapping an error we keep the cause of the error meaning that if we want to handle the error in a upper layer we need to...

When using errors.Wrap the default delimiter is ": ". But for me at least it seem like it should be "| ", with that I can wrap errors like this:...

``` package main import ( "fmt" "github.com/pkg/errors" ) func GiveError() error { return errors.New("this is an error") } func Outer() error { err := GiveError() return errors.WithStack(err) } func main()...