feat: add typed error message templates and stable replay snapshots
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user