feat: add typed error message templates and stable replay snapshots

This commit is contained in:
2026-09-24 15:05:08 +08:00
parent 2041e7f661
commit 6e3f025aad
32 changed files with 1570 additions and 99 deletions

View File

@@ -6,7 +6,8 @@ import (
)
// APIError is the public error shape used by handlers and middleware.
// Cause is retained for logging and unwrapping, but is never serialized.
// Cause is retained for logging and unwrapping; default response encoders and
// replay snapshots never serialize it.
type APIError struct {
Status int
Code string
@@ -14,6 +15,8 @@ type APIError struct {
Cause error
BusinessCode any // Optional public code resolved from a project catalog.
reference bool
params map[string]any
paramErr error
}
func (e *APIError) Error() string {