feat: include platformCode in error responses (v0.10.0)
- Error(w, err) now extracts PlatformCode() from *xerrors.Err and includes "platformCode" in the JSON body when set; omitted otherwise - errorBody updated to accept platformCode as an explicit parameter - Upgraded code.nochebuena.dev/go/xerrors dependency to v0.10.0 - Added two new tests: platformCode included when set, omitted when absent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
14
CHANGELOG.md
14
CHANGELOG.md
@@ -5,6 +5,20 @@ All notable changes to this module will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this module adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.10.0] - 2026-03-25
|
||||
|
||||
### Changed
|
||||
|
||||
- `Error(w http.ResponseWriter, err error)` — now includes `"platformCode"` in the JSON error body when the `*xerrors.Err` carries one; omitted otherwise
|
||||
- Upgraded `code.nochebuena.dev/go/xerrors` dependency to `v0.10.0`
|
||||
|
||||
### Design Notes
|
||||
|
||||
- `platformCode` is the domain-layer error identifier introduced in `xerrors` v0.10.0. It travels through `Error` transparently — no transport-layer logic depends on it.
|
||||
- Backwards-compatible: error responses without a platform code are identical to v0.9.0.
|
||||
|
||||
[0.10.0]: https://code.nochebuena.dev/go/httputil/compare/v0.9.0...v0.10.0
|
||||
|
||||
## [0.9.0] - 2026-03-18
|
||||
|
||||
### Added
|
||||
|
||||
Reference in New Issue
Block a user