From 9f883b458f8d4ebfff1a3752d9c7b01a7e83e7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 16 Sep 2024 15:27:32 +0200 Subject: [PATCH] v0.0.513 --- exerr/exerr.go | 7 +++++++ goextVersion.go | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/exerr/exerr.go b/exerr/exerr.go index dbc59b5..2269cab 100644 --- a/exerr/exerr.go +++ b/exerr/exerr.go @@ -38,6 +38,13 @@ func (ee *ExErr) Error() string { // Unwrap must be implemented so that some error.XXX methods work func (ee *ExErr) Unwrap() error { if ee.OriginalError == nil { + + if ee.WrappedErr != nil { + if werr, ok := ee.WrappedErr.(error); ok { + return werr + } + } + return nil // this is neccessary - otherwise we return a wrapped nil and the `x == nil` comparison fails (= panic in errors.Is and other failures) } return ee.OriginalError diff --git a/goextVersion.go b/goextVersion.go index 5fcc869..8052ec3 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.512" +const GoextVersion = "0.0.513" -const GoextVersionTimestamp = "2024-09-15T21:25:21+0200" +const GoextVersionTimestamp = "2024-09-16T15:27:32+0200"