Skip to content

Commit

Permalink
fix: nested add object (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
abyssparanoia authored Nov 19, 2024
1 parent b683cee commit 5c57d92
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,9 @@ func (x *Error) MarshalLogObject(enc zapcore.ObjectEncoder) error {
got := false
if inCause := x.Unwrap(); inCause != nil {
if err, ok := inCause.(*Error); ok {
if err := err.MarshalLogObject(enc); err != nil {
return err
}
enc.AddObject("cause", err)
got = true
}
got = true
}
if !got {
enc.AddString("cause", x.cause.Error())
Expand Down

0 comments on commit 5c57d92

Please sign in to comment.