Exception: Elements::ElementsError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/elements/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, http_status: nil, http_headers: nil, http_body: nil) ⇒ ElementsError

Returns a new instance of ElementsError.



53
54
55
56
57
58
59
60
# File 'lib/elements/errors.rb', line 53

def initialize(message = nil, http_status: nil, http_headers: nil, http_body: nil)
  super(message)
  @message = message
  @http_status = http_status
  @http_headers = http_headers
  @http_body = http_body
  @error = ErrorDetails.from_http_body(http_body)
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



49
50
51
# File 'lib/elements/errors.rb', line 49

def error
  @error
end

#http_bodyObject (readonly)

Returns the value of attribute http_body.



49
50
51
# File 'lib/elements/errors.rb', line 49

def http_body
  @http_body
end

#http_headersObject (readonly)

Returns the value of attribute http_headers.



49
50
51
# File 'lib/elements/errors.rb', line 49

def http_headers
  @http_headers
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



49
50
51
# File 'lib/elements/errors.rb', line 49

def http_status
  @http_status
end

#messageObject (readonly)

Returns the value of attribute message.



49
50
51
# File 'lib/elements/errors.rb', line 49

def message
  @message
end

#responseObject

Returns the value of attribute response.



51
52
53
# File 'lib/elements/errors.rb', line 51

def response
  @response
end