Skip to content

Commit

Permalink
Call the ExceptionNotifier for erros in FoodsoftMailReceiver
Browse files Browse the repository at this point in the history
  • Loading branch information
paroga committed Oct 5, 2017
1 parent 82b9721 commit 42ab8ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/foodsoft_mail_receiver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ def on_rcpt_to_event(ctx, rcpt_to)
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)
Expand Down

0 comments on commit 42ab8ee

Please sign in to comment.