Exception: Ethikdo::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ethikdo/error.rb

Direct Known Subclasses

ConnectionError, ResponseError, ServerError

Constant Summary collapse

NET_HTTP_ERRORS =
[
  EOFError,
  Errno::ECONNABORTED,
  Errno::ECONNREFUSED,
  Errno::ECONNRESET,
  Errno::EHOSTUNREACH,
  Errno::EINVAL,
  Errno::ENETUNREACH,
  Net::HTTPBadResponse,
  Net::HTTPHeaderSyntaxError,
  Net::ProtocolError,
  Net::OpenTimeout,
  Net::ReadTimeout,
  SocketError,
  Zlib::GzipFile::Error,
  OpenSSL::SSL::SSLError,
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response = nil) ⇒ Error

Returns a new instance of Error.



25
26
27
28
# File 'lib/ethikdo/error.rb', line 25

def initialize(response = nil)
  @http_response = response
  super(build_error_message)
end

Instance Attribute Details

#http_responseObject (readonly)

Returns the value of attribute http_response.



23
24
25
# File 'lib/ethikdo/error.rb', line 23

def http_response
  @http_response
end

Instance Method Details

#http_requestObject



30
31
32
# File 'lib/ethikdo/error.rb', line 30

def http_request
  http_response.request
end