From 260ba2e04a02945f24068fe3402cf0b838b74d63 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 26 Mar 2023 05:20:29 +0000 Subject: [PATCH] Add LockedTopic exception to MailHandler (#38273). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Felix Schäfer. git-svn-id: https://svn.redmine.org/redmine/trunk@22159 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mail_handler.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 738feb30e..8a4084769 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -24,6 +24,7 @@ class MailHandler < ActionMailer::Base class UnauthorizedAction < StandardError; end class NotAllowedInProject < UnauthorizedAction; end class InsufficientPermissions < UnauthorizedAction; end + class LockedTopic < UnauthorizedAction; end class MissingInformation < StandardError; end class MissingContainer < StandardError; end @@ -301,7 +302,7 @@ class MailHandler < ActionMailer::Base add_attachments(reply) reply else - logger&.info "MailHandler: ignoring reply from [#{email.from.first}] to a locked topic" + raise LockedTopic, "ignoring reply to a locked message [#{message.id} #{message.subject}]" end end -- 2.39.5