lib/logstash/outputs/email.rb in logstash-output-email-1.0.0 vs lib/logstash/outputs/email.rb in logstash-output-email-1.1.0
- old
+ new
@@ -245,10 +245,15 @@
end
@attachments.each do |fileLocation|
mail.add_file(fileLocation)
end # end @attachments.each
@logger.debug? and @logger.debug("Sending mail with these values : ", :from => mail.from, :to => mail.to, :cc => mail.cc, :subject => mail.subject)
- mail.deliver!
+ begin
+ mail.deliver!
+ rescue StandardError => e
+ @logger.error("Something happen while delivering an email", :exception => e)
+ @logger.debug? && @logger.debug("Processed event: ", :event => event)
+ end
end # end if successful
end # def receive
private