Skip to content

Commit 8c1937a

Browse files
committed
fix run-task error response
1 parent 0587e16 commit 8c1937a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/net/discordjug/javabot/systems/staff_commands/RunScheduledTaskCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.springframework.scheduling.config.ScheduledTaskHolder;
88

99
import net.discordjug.javabot.data.config.BotConfig;
10+
import net.discordjug.javabot.util.ExceptionLogger;
1011
import net.discordjug.javabot.util.Responses;
1112
import net.dv8tion.jda.api.Permission;
1213
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
@@ -67,7 +68,8 @@ public void execute(SlashCommandInteractionEvent event) {
6768
//CHECKSTYLE:OFF This is a handler for all sort of failures that could possibly happen
6869
}catch (RuntimeException e) {
6970
//CHECKSTYLE:ON
70-
Responses.error(event,
71+
ExceptionLogger.capture(e, getClass().getName());
72+
Responses.error(event.getHook(),
7173
"Task failed with an exception: %s",
7274
e.getClass().getName() + (e.getMessage() == null ? "" : ": "+e.getMessage()))
7375
.queue();

0 commit comments

Comments
 (0)