diff --git a/cmd/party/common/helpers.go b/cmd/party/common/helpers.go index 68c23c8..d83a73a 100644 --- a/cmd/party/common/helpers.go +++ b/cmd/party/common/helpers.go @@ -136,5 +136,11 @@ func (app *Application) LogError(r *http.Request, err error) { if buf, ok := r.Context().Value(RequestBodyKey).(*bytes.Buffer); ok && buf.Len() > 0 { props["request_body"] = buf.String() } + var apiErr *data.Error + if errors.As(err, &apiErr) { + for k, v := range apiErr.Details { + props[k] = v + } + } app.Logger.PrintError(err, props) }