fix: invoke CommandExecuted on async exception failures
This commit is contained in:
@@ -272,6 +272,10 @@ namespace Discord.Commands
|
|||||||
|
|
||||||
var wrappedEx = new CommandException(this, context, ex);
|
var wrappedEx = new CommandException(this, context, ex);
|
||||||
await Module.Service._cmdLogger.ErrorAsync(wrappedEx).ConfigureAwait(false);
|
await Module.Service._cmdLogger.ErrorAsync(wrappedEx).ConfigureAwait(false);
|
||||||
|
|
||||||
|
var result = ExecuteResult.FromError(CommandError.Exception, ex.Message);
|
||||||
|
await Module.Service._commandExecutedEvent.InvokeAsync(this, context, result).ConfigureAwait(false);
|
||||||
|
|
||||||
if (Module.Service._throwOnError)
|
if (Module.Service._throwOnError)
|
||||||
{
|
{
|
||||||
if (ex == originalEx)
|
if (ex == originalEx)
|
||||||
@@ -280,7 +284,7 @@ namespace Discord.Commands
|
|||||||
ExceptionDispatchInfo.Capture(ex).Throw();
|
ExceptionDispatchInfo.Capture(ex).Throw();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ExecuteResult.FromError(CommandError.Exception, ex.Message);
|
return result;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user