Exception: Ghostcrawl::ScrapeError
- Inherits:
-
GhostcrawlError
- Object
- StandardError
- GhostcrawlError
- Ghostcrawl::ScrapeError
- Defined in:
- lib/ghostcrawl/errors.rb
Overview
Raised when a request succeeds at the transport layer (HTTP 200) but the
target page could not be scraped — the RESULT channel. Carries the canonical
result-error code (e.g. "blocked", "captcha_required") plus the target's
own HTTP status when one is available.
Instance Attribute Summary collapse
-
#target_status ⇒ Integer?
readonly
The target site's HTTP status, when reported.
Attributes inherited from GhostcrawlError
#body, #code, #request_id, #retryable, #status_code
Instance Method Summary collapse
-
#initialize(message, status_code: 200, body: nil, code: nil, retryable: false, request_id: nil, target_status: nil) ⇒ ScrapeError
constructor
A new instance of ScrapeError.
Constructor Details
#initialize(message, status_code: 200, body: nil, code: nil, retryable: false, request_id: nil, target_status: nil) ⇒ ScrapeError
Returns a new instance of ScrapeError.
53 54 55 56 57 58 |
# File 'lib/ghostcrawl/errors.rb', line 53 def initialize(, status_code: 200, body: nil, code: nil, retryable: false, request_id: nil, target_status: nil) super(, status_code: status_code, body: body, code: code, retryable: retryable, request_id: request_id) @target_status = target_status end |
Instance Attribute Details
#target_status ⇒ Integer? (readonly)
Returns the target site's HTTP status, when reported.
51 52 53 |
# File 'lib/ghostcrawl/errors.rb', line 51 def target_status @target_status end |