src/main/java/exception/GlobalExceptionHandler.java
public static void handleException(SlashCommandEvent event, String name, Exception exception) {

        String messageFormat = "[" + name + "] :: " + exception.getMessage();

        System.out.println(messageFormat);

        event.getJDA().getGuildById(serverId).getTextChannelById(textChannelId)
                .sendMessage(messageFormat).queue();

    }
/**
     * Handle exception and send message to discord channel.
     * @param event SlashCommandEvent to interact with message
     * @param name Name of the class or exception tag
     * @param exception Exception
     *
     */
Handle exception and send message to discord channel.
@param event SlashCommandEvent to interact with message
@param name Name of the class or exception tag
@param exception Exception
Handle exception and send message to discord channel . @param event SlashCommandEvent to interact with message @param name Name of the class or exception tag @param exception Exception
public static void handleException(SlashCommandEvent event, String name, Exception exception) {
        String messageFormat = "[" + name + "] :: " + exception.getMessage();
        System.out.println(messageFormat);
        event.getJDA().getGuildById(serverId).getTextChannelById(textChannelId)
                .sendMessage(messageFormat).queue();
    }
public static void handleException ( SlashCommandEvent event , String name , Exception exception ) { String messageFormat = "[" + name + "] :: " + exception . getMessage ( ) ; System . out . println ( messageFormat ) ; event . getJDA ( ) . getGuildById ( serverId ) . getTextChannelById ( textChannelId ) . sendMessage ( messageFormat ) . queue ( ) ; }
Handle exception and send message to discord channel.
Handle exception and send message to discord channel .