Skip to content

fix(api): log body decode errors without body values - #83

Open
josuegiron wants to merge 1 commit into
masterfrom
fix/unmarshal-error-log-no-value
Open

josuegiron wants to merge 1 commit into
masterfrom
fix/unmarshal-error-log-no-value

Conversation

@josuegiron

Copy link
Copy Markdown
Member

Error records for a body that cannot be decoded no longer quote body values.

  • *json.UnmarshalTypeError is logged as kind, field, Go type and offset (json: cannot unmarshal number into Go struct field pin_code of type int16 (offset 21)); *json.SyntaxError as its offset only.
  • UnmarshalBody: any other error except the body limit becomes request body cannot be read or decoded (errors of a json.Unmarshaler such as time.Time may quote the value).
  • ProcessRequest/RequestBody rejected bodies: the two JSON error types are described the same way; other receiver errors are logged as before.
  • README Logging section updated; tests for each case.

Release: PATCH (v1.1.2); log content only (constitution V).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant