Skip to content

Commit

Permalink
fix missing slog record
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Weber authored and gregwebs committed Dec 5, 2024
1 parent 67b013d commit 35a157b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion structured.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func SlogRecord(inputErr error) *slog.Record {
}
}
} else if msgUnrecognized == "" {
if len(msgs) > 0 && newErrMsg != msgs[len(msgs)-1] {
if len(msgs) == 0 || newErrMsg != msgs[len(msgs)-1] {
msgUnrecognized = newErrMsg
}
} else {
Expand Down

0 comments on commit 35a157b

Please sign in to comment.