Exception: Vault::HTTPError
- Inherits:
-
VaultError
- Object
- RuntimeError
- VaultError
- Vault::HTTPError
- Defined in:
- lib/vault/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(address, response, errors = []) ⇒ HTTPError
constructor
A new instance of HTTPError.
Constructor Details
#initialize(address, response, errors = []) ⇒ HTTPError
Returns a new instance of HTTPError.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/vault/errors.rb', line 69 def initialize(address, response, errors = []) @address, @response, @errors = address, response, errors @code = response.code.to_i errors = errors.map { |error| " * #{error}" } super <<-EOH The Vault server at `#{address}' responded with a #{code}. Any additional information the server supplied is shown below: #{errors.join("\n").rstrip} Please refer to the documentation for help. EOH end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
67 68 69 |
# File 'lib/vault/errors.rb', line 67 def address @address end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
67 68 69 |
# File 'lib/vault/errors.rb', line 67 def code @code end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
67 68 69 |
# File 'lib/vault/errors.rb', line 67 def errors @errors end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
67 68 69 |
# File 'lib/vault/errors.rb', line 67 def response @response end |