We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed85620 commit d4e6e16Copy full SHA for d4e6e16
inspection.go
@@ -29,13 +29,16 @@ func Cause(err error) error {
29
return errors.Cause(err)
30
}
31
32
-// Unwrap returns the first occurrence of the underlying serializable Error type
33
-// using causer or create a new *Error type
34
-func Unwrap(err error) error {
+// Unwrap returns the first occurrence of the underlying *Error type
+// using causer or create a new *Error type containing the original error's message
+func Unwrap(err error) *Error {
35
+ if err == nil {
36
+ return nil
37
+ }
38
for err != nil {
- _, ok := err.(kinder)
39
+ e, ok := err.(*Error)
40
if ok {
- return err
41
+ return e
42
43
cause, ok := err.(causer)
44
if !ok {
0 commit comments