From c3d7ac651ce4209a6bdce7ffe2b691c46fbd26a2 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Thu, 19 Oct 2023 11:29:31 +0200 Subject: [PATCH] Add error message for lacking consumer startup Instead of relying on the user to interpret the existing debug logs and badmatch error, send an explicit error message when no consumer could be found that we can use in the shard connection. See #524. --- lib/nostrum/shard/session.ex | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/nostrum/shard/session.ex b/lib/nostrum/shard/session.ex index 4c21c7ce2..8cf2c895b 100644 --- a/lib/nostrum/shard/session.ex +++ b/lib/nostrum/shard/session.ex @@ -343,7 +343,14 @@ defmodule Nostrum.Shard.Session do {^reference, :join, _group, _who} -> :ok after - timeout -> :timeout + timeout -> + Logger.error( + "No consumers were running nor did any start up in time " <> + "for shard session startup. Is a consumer started as " <> + "part of your supervision tree?" + ) + + :timeout end end end