Skip to content

Commit

Permalink
error out when no recipients are specified
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Sep 14, 2024
1 parent af250e4 commit 880ae1f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prometheus_xmpp/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ async def serve_test(request):
recipients = [request.match_info['to_jid']]
except KeyError:
recipients = request.app['recipients']
if not recipients:
return web.Response(
status=500,
text="No recipients configured. Set `recipients` in configuration, `XMPP_RECIPIENTS` in environment or use /test/TO_JID.",
)

test_counter.inc()
try:
text, html = await render_alert(
Expand Down

0 comments on commit 880ae1f

Please sign in to comment.