.
This commit is contained in:
parent
2900582eb4
commit
f77bcb3772
@ -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 {
|
if buf, ok := r.Context().Value(RequestBodyKey).(*bytes.Buffer); ok && buf.Len() > 0 {
|
||||||
props["request_body"] = buf.String()
|
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)
|
app.Logger.PrintError(err, props)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user