Call the ExceptionNotifier for erros in FoodsoftMailReceiver
This commit is contained in:
parent
9cd3c800bd
commit
8111e3cc59
1 changed files with 9 additions and 3 deletions
|
@ -29,11 +29,17 @@ class FoodsoftMailReceiver < MidiSmtpServer::Smtpd
|
||||||
end
|
end
|
||||||
|
|
||||||
def on_message_data_event(ctx)
|
def on_message_data_event(ctx)
|
||||||
|
begin
|
||||||
@handlers.each do |handler|
|
@handlers.each do |handler|
|
||||||
handler.call(ctx[:message][:data])
|
handler.call(ctx[:message][:data])
|
||||||
end
|
end
|
||||||
|
rescue => error
|
||||||
|
ExceptionNotifier.notify_exception(error, data: ctx)
|
||||||
|
raise error
|
||||||
|
ensure
|
||||||
@handlers.clear
|
@handlers.clear
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def self.find_handler(recipient)
|
def self.find_handler(recipient)
|
||||||
m = /(?<foodcoop>[^@\.]+)\.(?<address>[^@]+)(@(?<hostname>[^@]+))?/.match recipient
|
m = /(?<foodcoop>[^@\.]+)\.(?<address>[^@]+)(@(?<hostname>[^@]+))?/.match recipient
|
||||||
|
|
Loading…
Reference in a new issue