Exception: WebinarJam::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/webinarjam/errors.rb

Overview

Raised when the API returns an error, either as a non-2xx HTTP status or as a 2xx response whose JSON body carries "status": "error".

Direct Known Subclasses

AuthenticationError, RateLimitError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, http_status: nil, body: nil) ⇒ APIError

Returns a new instance of APIError.



14
15
16
17
18
# File 'lib/webinarjam/errors.rb', line 14

def initialize(message, http_status: nil, body: nil)
  @http_status = http_status
  @body = body
  super(message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



12
13
14
# File 'lib/webinarjam/errors.rb', line 12

def body
  @body
end

#http_statusObject (readonly)

Returns the value of attribute http_status.



12
13
14
# File 'lib/webinarjam/errors.rb', line 12

def http_status
  @http_status
end