Exception: ScrapeUnblocker::APIError

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

Overview

An error response returned by the ScrapeUnblocker API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of APIError.



11
12
13
14
15
# File 'lib/scrapeunblocker/errors.rb', line 11

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



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

def status_code
  @status_code
end