Exception: Bolt::Plugin::Vault::VaultHTTPError

Inherits:
Error
  • Object
show all
Defined in:
lib/bolt/plugin/vault.rb

Instance Attribute Summary

Attributes inherited from Error

#details, #error_code, #issue_code, #kind

Instance Method Summary collapse

Methods inherited from Error

#msg, #to_h, #to_json, #to_puppet_error, unknown_plan, unknown_task

Constructor Details

#initialize(response) ⇒ VaultHTTPError

Returns a new instance of VaultHTTPError.



7
8
9
10
11
12
# File 'lib/bolt/plugin/vault.rb', line 7

def initialize(response)
  err = JSON.parse(response.body)['errors']
  m = String.new("#{response.code} \"#{response.msg}\"")
  m << ": #{err.join(';')}" unless err.nil?
  super(m, 'bolt.plugin/vault-http-error')
end