Skip to content

Commit 767eadc

Browse files
committed
disable feed if live channel got deleted
1 parent d85c02c commit 767eadc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/vc/live/LiveFeed.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,11 @@ public void syncChannels() {
159159
.block();
160160
liveChannels.put(config.guildId(), channel);
161161
} catch (final Exception e) {
162-
LOGGER.error("Error getting channel: {} for guild: {}", liveChannelId(config), config.guildId(), e);
163-
// disableFeed(config.guildId());
162+
LOGGER.error("Error getting channel: {} for guild: {} - {}", liveChannelId(config), config.guildId(), e.getMessage());
163+
if (e instanceof ClientException clientException && clientException.getStatus().code() == 404) {
164+
LOGGER.info("Disabling {} for guild: {} due to missing channel", feedName(), config.guildId());
165+
disableFeed(config.guildId());
166+
}
164167
}
165168
}
166169
}

0 commit comments

Comments
 (0)