Skip to content

fix: ensure we recognize errors as slog.AnyValue - #171

Merged
aymanbagabas merged 1 commit into
mainfrom
json-slog-anyvalue
May 12, 2025
Merged

aymanbagabas merged 1 commit into
mainfrom
json-slog-anyvalue

Conversation

@aymanbagabas

Copy link
Copy Markdown
Contributor

We need to type check any value to see if it is an error. While doing so, we also need to check if it doesn't have a json.Marshaler interface to avoid overwriting the error message with the marshaled value.

Fixes: #170

We need to type check any value to see if it is an error. While doing
so, we also need to check if it doesn't have a json.Marshaler interface
to avoid overwriting the error message with the marshaled value.

Fixes: #170
@aymanbagabas
aymanbagabas merged commit 71b7e86 into main May 12, 2025
@aymanbagabas
aymanbagabas deleted the json-slog-anyvalue branch May 12, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

log.Error() mishandles error printing

1 participant

⌂ 换网址