#How can I catch all the exceptions that occur in my Interaction Handler?

1 messages · Page 1 of 1 (latest)

waxen crystal
#

I have the code

var context = new SocketInteractionContext(_client, interaction);
                var result = await _services.ExecuteCommandAsync(context, _serviceProvider);
                if (!result.IsSuccess) Console.WriteLine(result.ErrorReason);

which I thought would print any exceptions that happen during slash command / interaction execution but it doesn't. I also tried to put a try catch statement around all that but it didn't work either.
How can I catch alle the exceptions that happen during interaction execution without putting a try catch statement in every one of my command methods?

lone talon