Exception: Qonto::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/qonto/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.



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

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.



21
22
23
# File 'lib/qonto/error.rb', line 21

def http_response
  @http_response
end

Instance Method Details

#http_requestObject



28
29
30
# File 'lib/qonto/error.rb', line 28

def http_request
  http_response.request
end