Module: Digicert::Errors

Defined in:
lib/digicert/errors.rb,
lib/digicert/errors/forbidden.rb,
lib/digicert/errors/server_error.rb,
lib/digicert/errors/unauthorized.rb,
lib/digicert/errors/request_error.rb

Defined Under Namespace

Classes: Forbidden, RequestError, ServerError, Unauthorized

Class Method Summary collapse

Class Method Details

.error_klass_for(response) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/digicert/errors.rb', line 21

def self.error_klass_for(response)
  case response
  when *server_errors then Errors::ServerError
  when Net::HTTPUnauthorized then Errors::Unauthorized
  when Net::HTTPForbidden then Errors::Forbidden
  else Errors::RequestError
  end
end

.server_errorsObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/digicert/errors.rb', line 8

def self.server_errors
  [
    OpenSSL::SSL::SSLError,
    Errno::ETIMEDOUT,
    Errno::EHOSTUNREACH,
    Errno::ENETUNREACH,
    Errno::ECONNRESET,
    Net::OpenTimeout,
    SocketError,
    Net::HTTPServerError,
  ]
end