Include which command failed to build on exception
This commit is contained in:
@@ -30,6 +30,8 @@ namespace Discord.Commands
|
||||
public IReadOnlyList<PreconditionAttribute> Preconditions { get; }
|
||||
|
||||
internal Command(MethodInfo source, Module module, object instance, CommandAttribute attribute, string groupPrefix)
|
||||
{
|
||||
try
|
||||
{
|
||||
Source = source;
|
||||
Module = module;
|
||||
@@ -65,6 +67,11 @@ namespace Discord.Commands
|
||||
Preconditions = BuildPreconditions(source);
|
||||
_action = BuildAction(source);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"Failed to build command {source.DeclaringType.FullName}.{source.Name}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<PreconditionResult> CheckPreconditions(IUserMessage context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user