Skip to content

Commit 01db53b

Browse files
committed
refactor(commands): fixed incorrect modmail error return in add_reminder command
1 parent 32ac30c commit 01db53b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/commands/add_reminder/text_command/add_reminder.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::commands::add_reminder::common::{send_register_confirmation, send_rem
22
use crate::config::Config;
33
use crate::db::reminders::{insert_reminder, update_reminder_status, Reminder};
44
use crate::db::threads::get_thread_by_user_id;
5-
use crate::errors::{common, CommandError, ModmailError, ModmailResult};
5+
use crate::errors::{common, CommandError, ModmailError, ModmailResult, ThreadError};
66
use crate::utils::command::extract_reply_content::extract_reply_content;
77
use chrono::{Local, NaiveTime};
88
use regex::Regex;
@@ -61,9 +61,7 @@ pub async fn add_reminder(ctx: &Context, msg: &Message, config: &Config) -> Modm
6161
let thread = match get_thread_by_user_id(msg.author.id, pool).await {
6262
Some(t) => t,
6363
None => {
64-
return Err(ModmailError::Command(CommandError::InvalidArguments(
65-
"No active thread found for user".to_string(),
66-
)));
64+
return Err(ModmailError::Thread(ThreadError::ThreadNotFound));
6765
}
6866
};
6967

0 commit comments

Comments
 (0)