Sha256: 2f9143bc0c97b29051b8084ec5433b165707e1063a9041a15b1598cfa49ddb80

Contents?: true

Size: 570 Bytes

Versions: 2

Compression:

Stored size: 570 Bytes

Contents

require 'net/http'
require 'net/smtp'

# Example:
#   begin
#     some http call
#   rescue *HTTP_ERRORS => error
#     notify_hoptoad error
#   end

HTTP_ERRORS = [
  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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pineapples-0.3.345 lib/pineapples/templates/lib/extensions/http_errors.rb
pineapples-0.3.34 lib/pineapples/templates/lib/extensions/http_errors.rb