Exception: CaptureSessionsError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, body) ⇒ CaptureSessionsError

Returns a new instance of CaptureSessionsError.



11
12
13
14
15
16
# File 'lib/capture.rb', line 11

def initialize(status, body)
  message = body.is_a?(Hash) && body["error"].is_a?(String) ? body["error"] : "Capture Sessions API request failed with status #{status}"
  super(message)
  @status = status
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



9
10
11
# File 'lib/capture.rb', line 9

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/capture.rb', line 9

def status
  @status
end