File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed
src/main/java/net/javadiscord/javabot/systems/qotw Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public class QOTWPointsService {
2828 *
2929 * @param userId The user's id.
3030 * @return An {@link QOTWAccount} object.
31- * @throws SQLException If an error occurs.
31+ * @throws DataAccessException If an error occurs.
3232 */
3333 @ Transactional
3434 public QOTWAccount getOrCreateAccount (long userId ) throws DataAccessException {
Original file line number Diff line number Diff line change @@ -39,19 +39,11 @@ public class QOTWReminderJob {
3939 public void execute () throws SQLException {
4040 for (Guild guild : jda .getGuilds ()) {
4141 ModerationConfig config = botConfig .get (guild ).getModerationConfig ();
42- try (Connection c = dataSource .getConnection ()) {
43- Optional <QOTWQuestion > q = questionQueueRepository .getNextQuestion (guild .getIdLong ());
44- if (q .isEmpty ()) {
45- notificationService .withGuild (guild ).sendToModerationLog (m -> m .sendMessageFormat (
46- "Warning! %s There's no Question of the Week in the queue. Please add one before it's time to post!" ,
47- config .getStaffRole ().getAsMention ()));
48- }
49- } catch (SQLException e ) {
50- ExceptionLogger .capture (e , getClass ().getSimpleName ());
51- notificationService .withGuild (guild ).sendToModerationLog (c -> c .sendMessageFormat (
52- "Warning! %s Could not check to see if there's a question in the QOTW queue:\n ```\n %s\n ```\n " ,
53- config .getStaffRole ().getAsMention (), e .getMessage ()));
54- throw e ;
42+ Optional <QOTWQuestion > q = questionQueueRepository .getNextQuestion (guild .getIdLong ());
43+ if (q .isEmpty ()) {
44+ notificationService .withGuild (guild ).sendToModerationLog (m -> m .sendMessageFormat (
45+ "Warning! %s There's no Question of the Week in the queue. Please add one before it's time to post!" ,
46+ config .getStaffRole ().getAsMention ()));
5547 }
5648 }
5749 }
You can’t perform that action at this time.
0 commit comments