Top Level Namespace

Defined Under Namespace

Modules: ApplicationHelper, CustomRequestLogger, Pineapples, Service, SimpleForm, TitleHelper, Virtus Classes: AddRoleFieldToUsers, AjaxFailure, ApplicationPolicy, ApplicationResponder, CreateDataMigrations, DeviseCreateUsers, EnablePostgresExtensions, FalseClass, NilClass, Numeric, PagesController, String, Symbol, TrueClass

Constant Summary collapse

SMTP_SETTINGS =
{
  authentication: ENV.fetch('SMTP_AUTHENTICATION', :plain).to_sym,
  enable_starttls_auto:  ENV.fetch('SMTP_STARTTLS', false),

  address: ENV.fetch('SMTP_ADDRESS'), # example: "smtp.sendgrid.net"
  domain: ENV.fetch('SMTP_DOMAIN'), # example: "heroku.com"
  port: ENV.fetch('SMTP_PORT', 587),

  user_name: ENV.fetch('SMTP_USERNAME'),
  password: ENV.fetch('SMTP_PASSWORD')
}
HTTP_ERRORS =

Example:

begin
  some http call
rescue *HTTP_ERRORS => error
  notify_hoptoad error
end
[
  EOFError,
  Errno::ECONNRESET,
  Errno::EINVAL,
  Net::HTTPBadResponse,
  Net::HTTPHeaderSyntaxError,
  Net::ProtocolError,
  Timeout::Error
]
SMTP_SERVER_ERRORS =
[
  IOError,
  Net::SMTPAuthenticationError,
  Net::SMTPServerBusy,
  Net::SMTPUnknownError,
  TimeoutError
]
SMTP_CLIENT_ERRORS =
[
  Net::SMTPFatalError,
  Net::SMTPSyntaxError
]
SMTP_ERRORS =
SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS