Merge pull request #2560 from nspcc-dev/rpc/extend-logging

rpc: extend error log message for failed RPC requests
This commit is contained in:
Roman Khimov 2022-06-27 09:42:54 +03:00 committed by GitHub
commit ea69b72cd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2260,7 +2260,10 @@ func (s *Server) packResponse(r *request.In, result interface{}, respErr *respon
// logRequestError is a request error logger.
func (s *Server) logRequestError(r *request.Request, jsonErr *response.Error) {
logFields := []zap.Field{
zap.String("cause", jsonErr.Data),
zap.Int64("code", jsonErr.Code),
}
if len(jsonErr.Data) != 0 {
logFields = append(logFields, zap.String("cause", jsonErr.Data))
}
if r.In != nil {