Call the ExceptionNotifier for erros in FoodsoftMailReceiver

This commit is contained in:
Patrick Gansterer 2017-10-05 17:40:00 +02:00
parent 9cd3c800bd
commit 8111e3cc59
1 changed files with 9 additions and 3 deletions

View File

@ -29,10 +29,16 @@ class FoodsoftMailReceiver < MidiSmtpServer::Smtpd
end
def on_message_data_event(ctx)
@handlers.each do |handler|
handler.call(ctx[:message][:data])
begin
@handlers.each do |handler|
handler.call(ctx[:message][:data])
end
rescue => error
ExceptionNotifier.notify_exception(error, data: ctx)
raise error
ensure
@handlers.clear
end
@handlers.clear
end
def self.find_handler(recipient)