Exception: ConfigStore::HTTPError
- Defined in:
- lib/configstore/exceptions.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code:, response:, message: nil) ⇒ HTTPError
constructor
A new instance of HTTPError.
- #to_s ⇒ Object
Constructor Details
#initialize(status_code:, response:, message: nil) ⇒ HTTPError
Returns a new instance of HTTPError.
7 8 9 10 11 12 |
# File 'lib/configstore/exceptions.rb', line 7 def initialize(status_code:, response:, message: nil) @status_code = status_code @response = response @message = @default_message = "ConfigStore API request failed with HTTP status code #{status_code}" end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/configstore/exceptions.rb', line 5 def response @response end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
5 6 7 |
# File 'lib/configstore/exceptions.rb', line 5 def status_code @status_code end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/configstore/exceptions.rb', line 14 def to_s return @message || @default_message end |