Exception: Scanii::Error

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

Overview

Base class for all errors raised by Scanii::Client. Carries the API-supplied message plus optional X-Scanii-Request-Id and X-Scanii-Host-Id headers for support handoffs.

Per SDK Principle 3 (integration-only) the SDK does not retry on the caller’s behalf – backoff is the caller’s responsibility.

Direct Known Subclasses

AuthError, RateLimitError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code: nil, request_id: nil, host_id: nil, body: nil) ⇒ Error

Returns a new instance of Error.



13
14
15
16
17
18
19
# File 'lib/scanii/error.rb', line 13

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



11
12
13
# File 'lib/scanii/error.rb', line 11

def body
  @body
end

#host_idObject (readonly)

Returns the value of attribute host_id.



11
12
13
# File 'lib/scanii/error.rb', line 11

def host_id
  @host_id
end

#request_idObject (readonly)

Returns the value of attribute request_id.



11
12
13
# File 'lib/scanii/error.rb', line 11

def request_id
  @request_id
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



11
12
13
# File 'lib/scanii/error.rb', line 11

def status_code
  @status_code
end