Exception: Vault::HTTPError
- Inherits:
-
VaultError
- Object
- RuntimeError
- VaultError
- Vault::HTTPError
- Defined in:
- lib/vault/errors.rb
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.
Instance Method Summary collapse
-
#initialize(address, code, errors = []) ⇒ HTTPError
constructor
A new instance of HTTPError.
Constructor Details
#initialize(address, code, errors = []) ⇒ HTTPError
Returns a new instance of HTTPError.
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/vault/errors.rb', line 34 def initialize(address, code, errors = []) @address, @code, @errors = address, code.to_i, errors 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.
32 33 34 |
# File 'lib/vault/errors.rb', line 32 def address @address end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
32 33 34 |
# File 'lib/vault/errors.rb', line 32 def code @code end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
32 33 34 |
# File 'lib/vault/errors.rb', line 32 def errors @errors end |