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

        System.out.println("[" + name + "] :: " + exception.getMessage());

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

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