| @@ -200,6 +200,7 @@ namespace Discord.Interactions | |||||
| while (ex is TargetInvocationException) | while (ex is TargetInvocationException) | ||||
| ex = ex.InnerException; | ex = ex.InnerException; | ||||
| var interactionException = new InteractionException(this, context, ex); | |||||
| await Module.CommandService._cmdLogger.ErrorAsync(ex).ConfigureAwait(false); | await Module.CommandService._cmdLogger.ErrorAsync(ex).ConfigureAwait(false); | ||||
| var result = ExecuteResult.FromError(ex); | var result = ExecuteResult.FromError(ex); | ||||
| @@ -0,0 +1,17 @@ | |||||
| using System; | |||||
| namespace Discord.Interactions | |||||
| { | |||||
| public class InteractionException : Exception | |||||
| { | |||||
| public ICommandInfo CommandInfo { get; } | |||||
| public IInteractionContext InteractionContext { get; } | |||||
| public InteractionException(ICommandInfo commandInfo, IInteractionContext context, Exception exception) | |||||
| : base($"Error occurred executing {commandInfo}.", exception) | |||||
| { | |||||
| CommandInfo = commandInfo; | |||||
| InteractionContext = context; | |||||
| } | |||||
| } | |||||
| } | |||||