extended logging

This commit is contained in:
Stephan D
2025-12-25 22:02:15 +01:00
parent 0ddd92b88b
commit 7b645a3bbe
3 changed files with 8 additions and 2 deletions

View File

@@ -183,6 +183,8 @@ func (l *loggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, erro
}
if resp.StatusCode >= 400 {
l.logger.Warn("RPC response error", respFields...)
} else if len(bodyBytes) == 0 {
l.logger.Warn("RPC response empty body", respFields...)
} else if len(bodyBytes) > 0 && !json.Valid(bodyBytes) {
l.logger.Warn("RPC response invalid JSON", respFields...)
}