Skip to content

Commit

Permalink
Catch all kind of exceptions on insult event
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Lindgren committed Mar 31, 2023
1 parent 8ddfbe2 commit ca5e12d
Showing 1 changed file with 22 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
package com.github.langebangen.kensa.listener;

import static com.github.langebangen.kensa.storage.generated.Tables.INSULT;

import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;

import discord4j.core.GatewayDiscordClient;
import discord4j.core.event.domain.message.MessageCreateEvent;
import reactor.core.publisher.Mono;
import rita.RiMarkov;

import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.SQLDialect;
import org.jooq.impl.DSL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.github.langebangen.kensa.audio.VoiceChannelConnection;
import com.github.langebangen.kensa.audio.VoiceConnections;
import com.github.langebangen.kensa.babylon.Babylon;
import com.github.langebangen.kensa.command.Action;
import com.github.langebangen.kensa.listener.event.BabylonEvent;
import com.github.langebangen.kensa.listener.event.HelpEvent;
import com.github.langebangen.kensa.listener.event.InsultEvent;
import com.github.langebangen.kensa.listener.event.InsultPersistEvent;
import com.github.langebangen.kensa.listener.event.RestartKensaEvent;
import com.github.langebangen.kensa.listener.event.*;
import com.github.langebangen.kensa.storage.Storage;
import com.github.langebangen.kensa.storage.generated.tables.records.InsultRecord;
import com.github.langebangen.kensa.util.KensaConstants;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import discord4j.core.GatewayDiscordClient;
import discord4j.core.event.domain.message.MessageCreateEvent;
import org.jooq.DSLContext;
import org.jooq.Record;
import org.jooq.SQLDialect;
import org.jooq.impl.DSL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.core.publisher.Mono;
import rita.RiMarkov;

import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;

import static com.github.langebangen.kensa.storage.generated.Tables.INSULT;


/**
Expand Down Expand Up @@ -135,7 +129,7 @@ private void onInsultEvent()
}
}
}
catch(SQLException e)
catch(Exception e)
{
logger.error("Error when fetching insult from storage.", e);
}
Expand Down

0 comments on commit ca5e12d

Please sign in to comment.