programandoarg/pg_rails

View on GitHub
pg_engine/config/initializers/action_mailer.rb

Summary

Maintainability
A
0 mins
Test Coverage
C
75%
class MailDeliveryTemporalError < PgEngine::Error; end

ActionMailer::MailDeliveryJob.rescue_from EOFError,
                                      IOError,
                                      # TimeoutError,
                                      Errno::ENETUNREACH,
                                      Errno::EHOSTUNREACH,
                                      Errno::ECONNRESET,
                                      Errno::ECONNABORTED,
                                      Errno::ECONNREFUSED,
                                      Errno::EPIPE,
                                      Errno::ETIMEDOUT,
                                      Net::SMTPAuthenticationError,
                                      Net::SMTPServerBusy,
                                      Net::SMTPSyntaxError,
                                      Net::SMTPUnknownError,
                                      Net::OpenTimeout,
                                      Net::ReadTimeout,
                                      OpenSSL::SSL::SSLError do |e|
  raise MailDeliveryTemporalError, e
end

ActionMailer::Base.register_observer(PgEngine::EmailObserver)