Releases: jjeffery/errors
Implement Unwrap() method
This release implements the Unwrap()
method for all error types that have a Cause()
method.
The Unwrap()
method implements the Wrapper
interface defined in the Go 2 draft designs for error inspection and printing.
Note that this release does not change the fact that use of this package is deprecated. It is intended to make this package usable with the new error inspection features, assuming that they make it into the Go standard library in a future release.
Patch to Cause() function
This release patches the Cause(err error)
function so that it will always return non-nil if its argument is non-nil.
A problem was encountered with the popular github.com/gorilla/securecookie
package. Errors returned by this package have a Cause()
method, but sometimes this method will return nil if there was no cause. This in turn would mean that the Cause(err error)
function in this package would return nil, even though it was passed a non-nil error.
The implementation has changed now so that if Cause(err error)
is passed a non-nil error, it will always return a non-nil value.