Skip to content

Commit e329d81

Browse files
committed
Updated ForumPoster to improve error descriptions
1 parent a65e393 commit e329d81

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

application/src/main/java/org/togetherjava/tjbot/features/utils/ForumPoster.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ public static ForumPoster using(JDA jda) {
2222

2323
private ForumChannel findForumChannel(String channelId) {
2424
return Optional.ofNullable(jda.getForumChannelById(channelId))
25-
.orElseThrow(() -> new IllegalStateException(
25+
.orElseThrow(() -> new IllegalArgumentException(
2626
"Did not find a forum channel with ID %s while trying to create a forum post. Make sure the config is setup properly."));
2727
}
2828

2929
private ThreadChannel findForumPost(String postId) {
3030
return Optional.ofNullable(jda.getThreadChannelById(postId))
31-
.orElseThrow(() -> new IllegalStateException(
32-
"Did not find the forum post with ID %s while trying to reply to a post. Make sure the config is setup properly."));
31+
.orElseThrow(() -> new IllegalArgumentException(
32+
"Did not find the forum post with ID %s while trying to reply to a post."));
3333

3434
}
3535

0 commit comments

Comments
 (0)