Skip to content

Commit 4ceb28a

Browse files
authored
Don't overwrite data from inner errors (#17)
1 parent 5c2e41f commit 4ceb28a

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

errors.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,10 @@ func (e *AsertoError) Err(err error) *AsertoError {
119119
if err == nil {
120120
return e
121121
}
122-
c := e.Copy()
123122

123+
c := e.Copy()
124124
c.errs = append(c.errs, err)
125125

126-
var aErr *AsertoError
127-
if ok := errors.As(err, &aErr); ok {
128-
for k, v := range aErr.data {
129-
if _, ok := c.data[k]; !ok {
130-
c.data[k] = v
131-
}
132-
}
133-
}
134-
135126
return c
136127
}
137128

0 commit comments

Comments
 (0)