Exception: ConfigStore::HTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/configstore/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = message
	@default_message = "ConfigStore API request failed with HTTP status code #{status_code}"
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/configstore/exceptions.rb', line 5

def response
  @response
end

#status_codeObject (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_sObject



14
15
16
# File 'lib/configstore/exceptions.rb', line 14

def to_s
	return @message || @default_message
end