mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(bot): throw better errors for (some) failed cache lookups
This commit is contained in:
parent
dfd3cba6dd
commit
e4f04b5bd5
2 changed files with 13 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue