Exception: GetFluxly::Error

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

Overview

Every error raised by the SDK is a GetFluxly::Error. ‘code` is one of the strings from docs/sdk-standards/error-taxonomy.md and is stable across SDK versions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code:, retryable: false, retry_after_ms: nil, status: nil, details: nil) ⇒ Error

Returns a new instance of Error.



10
11
12
13
14
15
16
17
# File 'lib/getfluxly/error.rb', line 10

def initialize(message, code:, retryable: false, retry_after_ms: nil, status: nil, details: nil)
  super(message)
  @code = code
  @retryable = retryable
  @retry_after_ms = retry_after_ms
  @status = status
  @details = details || {}
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/getfluxly/error.rb', line 8

def code
  @code
end

#detailsObject (readonly)

Returns the value of attribute details.



8
9
10
# File 'lib/getfluxly/error.rb', line 8

def details
  @details
end

#retry_after_msObject (readonly)

Returns the value of attribute retry_after_ms.



8
9
10
# File 'lib/getfluxly/error.rb', line 8

def retry_after_ms
  @retry_after_ms
end

#retryableObject (readonly)

Returns the value of attribute retryable.



8
9
10
# File 'lib/getfluxly/error.rb', line 8

def retryable
  @retryable
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/getfluxly/error.rb', line 8

def status
  @status
end

Instance Method Details

#inspectObject



19
20
21
# File 'lib/getfluxly/error.rb', line 19

def inspect
  "#<GetFluxly::Error code=#{@code.inspect} retryable=#{@retryable} status=#{@status.inspect}>"
end