fix(bot): throw better errors for (some) failed cache lookups

This commit is contained in:
alyssa 2024-11-14 11:45:40 +09:00
parent dfd3cba6dd
commit e4f04b5bd5
2 changed files with 13 additions and 6 deletions

View file

@ -50,7 +50,8 @@ public static class CacheExtensions
if (!channel.IsThread())
return channel;
var parent = await cache.GetChannel(guildId, channel.ParentId!.Value);
var parent = await cache.TryGetChannel(guildId, channel.ParentId!.Value);
if (parent == null) throw new Exception($"failed to find parent channel for thread {channelOrThread} in cache");
return parent;
}
}