FIX: save email rejection error class names for incoming email logs (#16095)
This commit is contained in:
parent
a558c5bd30
commit
567be512c9
|
@ -83,9 +83,7 @@ module Email
|
|||
|
||||
post
|
||||
rescue Exception => e
|
||||
error = e.to_s
|
||||
error = e.class.name if error.blank?
|
||||
@incoming_email.update_columns(error: error) if @incoming_email
|
||||
@incoming_email.update_columns(error: e.class.name) if @incoming_email
|
||||
delete_staged_users
|
||||
raise
|
||||
end
|
||||
|
|
|
@ -120,7 +120,7 @@ describe Email::Processor do
|
|||
expect(errors.first).to include("boom")
|
||||
|
||||
incoming_email = IncomingEmail.last
|
||||
expect(incoming_email.error).to eq("boom")
|
||||
expect(incoming_email.error).to eq("RuntimeError")
|
||||
expect(incoming_email.rejection_message).to be_present
|
||||
|
||||
expect(EmailLog.last.email_type).to eq("email_reject_unrecognized_error")
|
||||
|
|
|
@ -98,6 +98,7 @@ describe Email::Receiver do
|
|||
expect { process(:old_destination) }.to raise_error(
|
||||
Email::Receiver::OldDestinationError
|
||||
)
|
||||
expect(IncomingEmail.last.error).to eq("Email::Receiver::OldDestinationError")
|
||||
|
||||
SiteSetting.disallow_reply_by_email_after_days = 0
|
||||
IncomingEmail.destroy_all
|
||||
|
|
Loading…
Reference in New Issue