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

`Wrap()` and `Wrapf()` are good example of annotating error with stack trace and given error message. `Wrap()` and `Wrapf()` are best option if errors comes in different labels(different function). If...

Fixes https://github.com/pkg/errors/issues/102 With these changes, when using a plain `withMessage()`, we'll print the additional message in front of the original error message, above the stack trace. This maintains the correct...

This apply feature suggested by #75. Wrap() and Wrapf() now only add withStack when there are no stack captured before in error chain. The stack can still be forced via...

https://golang.org/doc/go1.12#compiler requires changes to the way the stack is analysed. See https://github.com/pkg/errors/blob/ba968bfe8b2f7e042a574c888954fccecfa385b4/stack.go#L136 in v0.8.1 for example.

Hi, Let's assume we have some nested errors: ~~~ function sthBuiltInWhichReturnsAPlainError() error { return someBuiltErrorWithoutStack } func customFunctionWhichWrapsErrors() error { err := sthBuiltInWhichReturnsAPlainError() if err != nil { return errors.Wrap(err,...

Hi, I am trying to write a library to interoperate with wrapped errors. There are many error wrapping libraries, but I can only get the StackTrace() of this one by...

The io package declares an EOF error like this: var EOF = errors.New("EOF") using this pattern to raise custom errors leads to ugly stack traces since the errors are generated...

The current errors.Cause method will gladly return a nil'error if given a nil error (this is expected). However, if the bottom of your error stack is a Causer that also...

enhancement
question

When causer.Cause() returns nil or itself, it is the cause. Ref: pkg#89

### Description The documentation of [Frame.Format](https://github.com/pkg/errors/blob/master/stack.go#L49) promises: ``` // %+s function name and path of source file relative to the compile time // GOPATH separated by \n\t (\n\t) // %+v...