Browse Source

Merge 044a4d99b8 into 71e9ecb21e

pull/2584/merge
Cenk Ergen GitHub 2 years ago
parent
commit
b4ebb1553a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions
  1. +1
    -0
      src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs
  2. +17
    -0
      src/Discord.Net.Interactions/InteractionException.cs

+ 1
- 0
src/Discord.Net.Interactions/Info/Commands/CommandInfo.cs View File

@@ -165,6 +165,7 @@ namespace Discord.Interactions
while (ex is TargetInvocationException)
ex = ex.InnerException;

var interactionException = new InteractionException(this, context, ex);
await Module.CommandService._cmdLogger.ErrorAsync(ex).ConfigureAwait(false);

var result = ExecuteResult.FromError(ex);


+ 17
- 0
src/Discord.Net.Interactions/InteractionException.cs View File

@@ -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;
}
}
}

Loading…
Cancel
Save