feat: add WithPlatformCode for domain-level error identity (v0.10.0) #2

Merged
Rene Nochebuena merged 1 commits from feature/platform-code into main 2026-03-25 16:42:15 -06:00

1 Commits

Author SHA1 Message Date
5e92f17f3b feat: add WithPlatformCode for domain-level error identity
Adds an optional PlatformCode field to *Err, decoupled from the
transport-level Code. Code drives HTTP/gRPC status mapping;
PlatformCode is a stable domain identifier for consuming applications
(e.g. a frontend performing i18n) to map errors to localised messages.

Platform codes are optional — errors without a user-actionable meaning
(500s, infrastructure failures, auth rejections) carry none.

Fully backwards-compatible: no existing signatures or JSON output changed
for errors without a platform code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 22:33:27 +00:00