Exception: OpenFeature::OFREP::RateLimited

Inherits:
StandardError
  • Object
show all
Defined in:
lib/openfeature/ofrep/provider/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RateLimited

Returns a new instance of RateLimited.



68
69
70
71
72
73
74
75
# File 'lib/openfeature/ofrep/provider/errors.rb', line 68

def initialize(response)
  error_message = "Rate limited"
  error_message += ": #{response["Retry-After"]}" if response&.[]("Retry-After")
  @response = response
  @error_code = SDK::Provider::ErrorCode::GENERAL
  @error_message = error_message
  super(error_message)
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



66
67
68
# File 'lib/openfeature/ofrep/provider/errors.rb', line 66

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



66
67
68
# File 'lib/openfeature/ofrep/provider/errors.rb', line 66

def error_message
  @error_message
end

#responseObject (readonly)

Returns the value of attribute response.



66
67
68
# File 'lib/openfeature/ofrep/provider/errors.rb', line 66

def response
  @response
end