From da06ae448528b08215c69fa90de5162869ac6623 Mon Sep 17 00:00:00 2001 From: binwiederhier Date: Tue, 23 May 2023 13:20:43 -0400 Subject: [PATCH] Clarify error message for poll requests --- server/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index 14a8c7f..d7630aa 100644 --- a/server/server.go +++ b/server/server.go @@ -868,7 +868,11 @@ func (s *Server) forwardPollRequest(v *visitor, m *message) { logvm(v, m).Err(err).Warn("Unable to publish poll request") return } else if response.StatusCode != http.StatusOK { - logvm(v, m).Err(err).Warn("Unable to publish poll request, unexpected HTTP status: %d", response.StatusCode) + if response.StatusCode == http.StatusTooManyRequests { + logvm(v, m).Err(err).Warn("Unable to publish poll request, the upstream server %s responded with HTTP %s; you may solve this by sending fewer daily messages, or by configuring upstream-access-token (assuming you have an account with higher rate limits) ", s.config.UpstreamBaseURL, response.Status) + } else { + logvm(v, m).Err(err).Warn("Unable to publish poll request to %s, the upstream server %s responded with HTTP %s", s.config.UpstreamBaseURL, response.Status) + } return } }